<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Opkle Blog</title>
    <link>https://opkle.app/abstract/blog?lang=en</link>
    <description>Graphic design tool guides and design know-how from Opkle Editor, a graphic design tool with no subscription.</description>
    <language>en</language>
    <lastBuildDate>Tue, 17 Nov 2026 03:06:26 GMT</lastBuildDate>
    <atom:link href="https://opkle.app/rss.en.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>Color Combinations — Palette Basics and Color Styles</title>
      <link>https://opkle.app/abstract/blog/design/color-palette-basics?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/design/color-palette-basics?lang=en</guid>
      <description><![CDATA[<p>When you first start designing, color is what you agonize over longest. You pick colors you like one at a time and stack them up, but the whole thing looks scattered somehow, while other people's work looks tidy with just a few colors. The same shapes and the same type can give a design a completely different impression through color combination alone, so palettes tend to feel like a matter of instinct.</p>
<p>But well-organized palettes mostly follow principles that repeat. Use fewer colors, give each color a role, and let differences in lightness create the order in which things get read. Once you know these principles, you can stop hunting for “pretty colors” and start choosing “the right color for this spot.” And if you also have a way to apply the colors you've settled on across the whole design without drift, the consistency holds even as the project grows.</p>
<p>In this article, we look at the basic principles for building a palette, and how to manage the colors you've chosen in a design tool.</p>
<p>1. <strong>The three properties of color</strong> — what hue, lightness, and saturation each change.</p>
<p>2. <strong>Palettes by role</strong> — the main, secondary, and accent colors, and the 60:30:10 ratio.</p>
<p>3. <strong>Lightness contrast</strong> — why a color can be pretty and still unreadable.</p>
<p>4. <strong>A practical order for choosing colors</strong> — how to grow a palette from one brand color.</p>
<p>5. <strong>Color styles and color variables</strong> — how to use chosen colors consistently across a whole design.</p>
<h2>Color Is Made of Three Properties</h2>
<p>The reason choosing colors feels so daunting is that you see a color as one lump. Color can be broken into three properties. Hue is the kind of color, such as red, blue, or green. Lightness is how bright it is, and saturation is how vivid it is.</p>
<p>Once you separate these three, palette problems become much more concrete. The worry that “the colors look tacky” usually means several highly saturated colors are mixed together. The worry that “the text is hard to read” usually means the text and background have similar lightness. And the feeling that “the mood is cold” is often because the hues are clustered on the blue side. If you can pinpoint the problem by property, you can fix it by adjusting just that one property, without replacing the colors wholesale.</p>
<p>If you look at well-organized designs, you'll often find the hues narrowed to two or three, with several lightness steps of the same hue used instead. A deep navy headline, a mid-tone blue button, and a very pale sky-blue background: change only the lightness within one hue, and even though several colors are used, they read as one mood.</p>
<h2>Give Colors Roles — 60:30:10</h2>
<p>The most common reason a palette feels scattered is that every color competes with the same weight. An old way to avoid this is to give each color a role.</p>
<p><strong>The three roles of color</strong></p>
<ul>
<li>The <strong>main color</strong> is the background color that takes up most of the screen. White, light gray, or a very pale brand color is usually used, taking up about 60%.</li>
<li>The <strong>secondary color</strong> shows the character of the design, in headlines, large blocks, and bands over photos, and takes up about 30%.</li>
<li>The <strong>accent color</strong> is a signal that says “look here.” Use it only on buttons, prices, and important numbers, and save it at about 10%.</li>
</ul>
<p>60:30:10 is less a formula to follow exactly than a guide to give each color a different weight. The key is to save the accent color. If the accent shows up everywhere, it stops being an accent, and the whole screen seems to shout. But if the accent appears on just one button, the viewer's eye goes to that button naturally.</p>
<h2>Pretty but Unreadable Is a Failure — Lightness Contrast</h2>
<p>If you like a color combination but the text isn't easy to read, that palette has failed. What decides readability is not hue but the difference in lightness. Even if the hues are completely different, like green text on a red background, similar lightness makes the text look blurry and run together, and switched to black and white, the text nearly disappears.</p>
<p>There's a simple way to check: turn the design black and white. In Opkle Editor, select an element and pull saturation all the way down in the filter section on the right, or if it's a photo, click the black-and-white button. If the headline, body text, and buttons still stand apart clearly in black and white, the lightness contrast is sufficient. When you've finished checking, undo with ⌘Z.</p>
<p>The Web Content Accessibility Guidelines (WCAG) recommend a lightness contrast of at least 4.5:1 for regular text. You don't need to measure numbers for every design, but it's worth a second look whenever you're tempted to put light gray text on a white background. The smaller the text, and the brighter the place it's viewed, like a phone screen, the more contrast it needs.</p>
<h2>Grow a Palette From One Brand Color</h2>
<p>Trying to pick several colors from scratch is daunting. It's easier to settle on one base color first and expand from there. If your logo or brand already uses a color, that color is the starting point.</p>
<p><strong>The order for expanding a palette</strong></p>
<ul>
<li>Change the base color's lightness to make two dark steps and two or three light steps. Use the dark ones for headlines and text, and the light ones for backgrounds and cards.</li>
<li>Instead of picking a gray separately, use a gray with just a touch of the base color mixed in. It blends into the overall mood far more naturally than a pure gray.</li>
<li>Choose just one accent color, either the opposite hue of the base color or a more saturated version of the same family.</li>
<li>If you need colors with fixed meanings, like success, warning, and error, match green, orange, and red to the same saturation level as the base color.</li>
</ul>
<p>Borrowing colors from a photo or poster you like is also a good method. In Opkle Editor, click anywhere on the screen with the picker (I) and that color becomes the fill of the selected element, so you can place a reference image on one side of the canvas and pull out colors one by one to build a palette. Even then, rather than using them as they are, matching the saturation of the picked colors to a similar level makes the result look far more orderly.</p>
<h2>Store Chosen Colors as Styles</h2>
<p>Even if you chose your colors well, as a project drags on, blues that are similar but slightly different tend to creep in here and there. The way to prevent this is to store the chosen colors as styles and draw from them only.</p>
<p>In Opkle Editor, click the ⁘ button on the Fill section's title row to open the fill style panel. Click an empty slot and the current color is saved as a new style; select another element and click a chip, and that color is applied. When you change a chip's color, the color of every element using that chip changes with it, so when you want to tweak a brand color slightly, you can fix the whole design at once. The color chips in the inspector's style settings are a 72-slot color style panel, which suits gathering a whole palette in one place.</p>
<p>If you're working on an app screen that needs dark mode, try color variables. When you connect a chip to a color variable, it holds two values, light and dark, and by choosing light or dark per artboard you can view the bright and dark versions of the same design side by side. If you want to tidy up colors already painted here and there, find “Select — Same Fill” in Quick Actions (⌘/), select every element using the same color at once, and click a style chip to swap them.</p>
<h2>Common Color Mistakes and How to Fix Them</h2>
<p>When a palette feels off, the cause usually narrows down to a few things. If your design looks uncomfortable somehow, check it against the list below one item at a time.</p>
<p><strong>Common mistakes</strong></p>
<ul>
<li><strong>Using pure primaries as they are</strong> — red, blue, and green at 100% saturation tend to tire the eyes and look cheap. Lowering the saturation a little, or the lightness slightly, makes the same hue far calmer.</li>
<li><strong>Pure black text</strong> — fully black text on a white background has too much contrast and looks stiff. A very dark gray, or a dark color with a hint of the brand color, softens it.</li>
<li><strong>Several accent colors</strong> — with a red button, a yellow badge, and a green icon together, you can't tell what's important. Settle on one accent color and demote the rest to secondary colors or gray.</li>
<li><strong>Background colors that fight the photo</strong> — put a highly saturated background next to a colorful photo and both get buried. If the photo is the star, let the background step back to white or light gray.</li>
</ul>
<p>When you need to put text over a photo and the photo's colors make the text hard to read, try laying one translucent dark layer over the photo. In Opkle Editor you can stack several fills on a single shape and set the layer's density in the opacity field, so you can keep the photo's mood and make the text clear without creating a separate layer.</p>
<h2>A Palette Starts With Reducing</h2>
<p>A good palette is more about taking away than adding. Narrow the hues to two or three, build steps with lightness, and use the accent color in just one truly important place. Then check that it still reads in black and white. Following just these four things makes most designs far calmer and clearer.</p>
<p>A sense for color isn't something you're born with; it builds up. If you get into the habit of counting, whenever you see a design you like, how many colors it uses, which color covers the most area, and where the accent color sits, before long you'll be able to create the same order in your own designs.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>Breaking color into hue, lightness, and saturation shows concretely what needs fixing.</li>
<li>Divide roles among the main, secondary, and accent colors, and save the accent at about 10%.</li>
<li>Lightness difference decides readability. Check that things still stand apart in black and white.</li>
<li>Build lightness steps from one base color, and expand the palette with a gray tinted by the base color and one accent color.</li>
<li>Store chosen colors as fill styles, color chips, and color variables, and the whole design changes together when you edit them.</li>
</ul>]]></description>
      <category>design</category>
      <pubDate>Tue, 10 Nov 2026 08:21:47 GMT</pubDate>
    </item>
    <item>
      <title>Instagram Carousel Design, Start to Finish</title>
      <link>https://opkle.app/abstract/blog/design/instagram-card-news-design?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/design/instagram-card-news-design?lang=en</guid>
      <description><![CDATA[<p>The Instagram carousel, a swipeable series of image cards known in Korea as card news, is one of the most commonly made designs today. Shop announcements, course promotions, information roundups, book introductions: a format you flip through image by image keeps people longer than a short post and gets saved and shared more. That also makes it a design you have to produce every week, sometimes every day.</p>
<p>Making card news, you run into two difficulties. One is stopping the thumb on the first card; the other is the labor of repeating nearly ten images in the same style. The first is a matter of structure and design, and the second is a matter of how you work. Both get much lighter once you know the principles and use your tool well.</p>
<p>In this article, we follow one card news piece in order, from planning to export.</p>
<p>1. <strong>Size and card count</strong> — decide the ratio and how many cards.</p>
<p>2. <strong>Story structure</strong> — plan the flow from the cover to the last card.</p>
<p>3. <strong>Cover design</strong> — how to make people stop on the first card.</p>
<p>4. <strong>Body card design</strong> — how to repeat the same frame so it's easy to read.</p>
<p>5. <strong>Cutting repetitive work and exporting</strong> — how to ease the weekly labor and export everything at once.</p>
<h2>Start With Size and Card Count</h2>
<p>On the Instagram feed, the ratio that takes up the most screen is vertical 4:5. At 1080×1350px, it takes up more of the screen than a square, so the chance that a swiping thumb stops goes up. Square 1:1 (1080×1080px) is still widely used, but if you're starting fresh, it's better to make 4:5 your default.</p>
<p>In Opkle Editor, press Crop (C) with nothing selected to enter the mode for setting the artboard size, and you can pick Instagram and mobile ratios like 4:5 straight from the presets. Each preset also shows its actual pixel size, so there's no need to calculate the numbers separately.</p>
<p>Match the card count to what you want to say, but at first, aim for between six and ten cards. Too short and there isn't enough information worth saving; too long and people drop off midway. If you set the rule of one message per card, the count settles naturally.</p>
<h2>Plan the Story Structure First</h2>
<p>A good card news piece puts structure before design. People read to the end only when there is a continuing reason to swipe to the next card. Before you open the design tool, write out one sentence for each card.</p>
<p><strong>A commonly used flow</strong></p>
<ul>
<li><strong>Cover</strong> — show in one sentence what the story is about and why they should swipe.</li>
<li><strong>Empathy</strong> — point to a problem or question the reader has, making it “their story.”</li>
<li><strong>Body</strong> — unfold the core content one point per card, numbered in order.</li>
<li><strong>Summary</strong> — gather the previous content onto one card so people want to save it.</li>
<li><strong>Last card</strong> — state clearly the one action you want, such as follow, save, or visit a link.</li>
</ul>
<p>The summary card matters more than you might think. People save information they want to see again, and a summary organized on one card gives them a reason to save. On the last card, picking just one desired action, rather than listing several, makes it more likely to lead to real action.</p>
<h2>The Cover Must Read Within 3 Seconds</h2>
<p>To someone scrolling the feed, the cover is visible for only a second or two. What it's about has to read within that time. That's why the cover's title should be big, short, and specific. A title with a clear number and audience, like “5 Color Mistakes Beginner Designers Make Most,” stops the thumb better than “Design Tips.”</p>
<p>On the cover, cut the word count and raise the size. On a phone screen the card looks much smaller than it really is, so a size that seems fine in the design tool feels small in the feed. If you use a photo as the background, lay a translucent color layer over it so the text reads, and use the accent color on just one key word of the title for the best effect. In Opkle Editor you can stack several fills on a single shape, so you can create the effect of a color layer over a photo without piling up several layers.</p>
<h2>Repeat the Same Frame for Body Cards</h2>
<p>Unlike the cover, the goal of body cards is to be “easy to read.” If you redesign each card, readers have to find where to look all over again every time. But if the title position, body position, and page number position are the same on every card, readers learn the rule after just two or three cards and can focus on the content alone.</p>
<p>When setting the frame, decide the top-bottom and left-right margins first, then the position and size of the title, body, and page number. Keep body text to three or four lines per card, and when lines run long, it's better to split the card. If you place the brand or account name small in the same spot on every card, the source stays attached even when the images are shared separately.</p>
<h2>Cut the Repetitive Work and Export All at Once</h2>
<p>Card news repeats the same work every time. In Opkle Editor you work with several artboards side by side on one canvas, so the quickest way is to finish the first body card, then duplicate the artboard and change only the text. As artboards multiply, move to the next and previous artboard with N and ⇧N, and gather all the artboards onto one screen with ⇧1 to check the overall flow.</p>
<p>If you make the header, page number, and account name group that goes on every card into a component, editing the single original changes every card at once. Store the title and body text looks as paragraph styles and the brand colors as fill styles, and next week's card news can draw on the same look as it is. For cards with photos, right-click the photo and choose Canvas Cover to fit it to the artboard with no gaps, and the color tone of several photos can be matched at once with an adjustment style.</p>
<p>When everything is made, choose all artboards in Export at the bottom right and the cards come out bundled into a single zip file. For text-heavy card news, export as PNG rather than JPG so the edges of the letters stay crisp instead of smudged. If you name the artboards in order, like 01 and 02, the files are organized in order too, making them easy to upload.</p>
<h2>What to Check Before Posting</h2>
<p>Card news is hard to fix once posted, because fixing a single word means deleting the post and uploading it again. Keeping a short checklist to skim before exporting greatly cuts down mistakes.</p>
<p><strong>Pre-posting checklist</strong></p>
<ul>
<li><strong>Did you view it at phone size?</strong> — Shrink the view to the real feed size and check that the cover title reads at a glance.</li>
<li><strong>Any typos?</strong> — Text inside images can't be searched or spell-checked. Read each card aloud once.</li>
<li><strong>Are the card order and page numbers right?</strong> — When making cards by duplicating artboards, it's easy to move on without fixing the page number.</li>
<li><strong>Is anything getting cut off?</strong> — In the feed grid, the top and bottom of a 4:5 card can look slightly cropped, so keep the cover's important text toward the center.</li>
<li><strong>Do you have the rights to the photos and fonts?</strong> — Check that no one else's photos or fonts barred from commercial use have slipped in.</li>
</ul>
<p>The caption is part of the card news too. Putting in the caption the explanations, sources, and related links that didn't fit on the cards helps people who saved it when they return to it later. Restate the core of the cards in one sentence on the first line, so that the caption alone tells what the post is about.</p>
<h2>A Carousel Is Completed as a Series</h2>
<p>A single card news piece passes quickly, but a series that continues steadily in the same frame becomes the face of an account. If you set the frame, styles, and components carefully when making the first piece, from the second piece on you can focus on the content alone. Few outputs show as well as card news that design isn't something you redo each time, but something you keep up by steadily following rules you set well once.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>On the Instagram feed, vertical 4:5 (1080×1350px) takes up the most screen; aim for six to ten cards, with one message per card.</li>
<li>Write the flow of cover, empathy, body, summary, one action as sentences before designing.</li>
<li>Make the cover title big, short, and specific, and repeat the same frame on body cards for easy reading.</li>
<li>Cut repetitive work with artboard duplication, components, paragraph styles, and fill styles, and reuse them as they are in the next piece.</li>
<li>Export all artboards at once as a zip, and export text-heavy cards as PNG to keep them crisp.</li>
</ul>]]></description>
      <category>design</category>
      <pubDate>Tue, 10 Nov 2026 08:21:47 GMT</pubDate>
    </item>
    <item>
      <title>Layout Basics — Alignment, Whitespace, Grouping, Grids</title>
      <link>https://opkle.app/abstract/blog/design/layout-alignment-whitespace-grid?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/design/layout-alignment-whitespace-grid?lang=en</guid>
      <description><![CDATA[<p>Use the same photo and the same text, and one design looks orderly while another looks cluttered. If the colors are fine and the font is decent but something still feels off, the cause is usually placement. Elements are subtly out of line, the spacing is inconsistent, or unrelated things sit close together while related things are far apart.</p>
<p>Layout looks like a matter of instinct, but a handful of principles explain most of it: alignment, proximity, contrast, and repetition, which design primers have emphasized for a long time, along with whitespace and grids. These principles apply equally to a poster, card news, or an app screen, so once you've learned them, they serve as your standard whatever you make.</p>
<p>In this article, we look at the basic principles for tidying up a layout, and how to follow them precisely in a design tool.</p>
<p>1. <strong>Alignment</strong> — why lining up invisible lines matters.</p>
<p>2. <strong>Proximity and whitespace</strong> — how to show what belongs together through spacing.</p>
<p>3. <strong>Contrast and repetition</strong> — how to guide the eye and create unity.</p>
<p>4. <strong>Grids</strong> — how to bind many elements and many pages into one order.</p>
<p>5. The <strong>tools for precise placement</strong> in a design tool.</p>
<h2>Alignment — Line Up the Invisible Lines</h2>
<p>Look closely at a well-ordered design and you'll see the elements standing on invisible lines. The left edge of the headline, the left edge of the body text, and the left edge of the photo line up in one row, and the button sits on the card's center line. The more of these invisible lines there are, and the more they coincide, the more solid the design looks.</p>
<p>A common mistake is to center everything. Centering works where symmetry suits, like a short headline or an invitation, but when several lines of text and several elements mix, each line starts at a different point and the eye has nowhere to rest. For an information-heavy design, setting up one strong vertical line with left alignment is much more stable. When you mix alignment styles within one design, you need a clear rule, such as “only the headline is centered, everything else is left-aligned.”</p>
<p>If you align by eye, things easily drift by a pixel or two, and those small drifts add up to a feeling of “somehow awkward.” So for alignment especially, it's best to get the tool's help and match things exactly.</p>
<h2>Proximity and Whitespace — Spacing Tells What Belongs Together</h2>
<p>People read things that are close together as one group. If the caption beneath a photo sits close to that photo, it reads as that photo's description, and if it's closer to the next photo, confusion follows. So spacing isn't just about spreading things out to look nice; it's information that tells you “what goes with what.”</p>
<p><strong>Rules for setting spacing</strong></p>
<ul>
<li>Keep spacing inside a group narrow and spacing between groups wide. The clearer the difference between the two, the better the structure reads.</li>
<li>Settle on a few spacing values and use only those. Choosing regular multiples like 8, 16, 24, 32, and 48 makes choosing easy and creates rhythm.</li>
<li>Leave the margin at the artboard's edge more generous than you'd think. Text pressed up against the edge feels cramped, and in print it risks being cut off.</li>
</ul>
<p>Think of whitespace not as “empty space” but as “material of the design,” and your layouts change. When you want to add one more element, try removing one instead and leaving that spot as whitespace. The remaining elements can breathe, and each stands out more clearly. That's why the more upscale a design looks, the more generous its whitespace.</p>
<h2>Contrast and Repetition — Guide the Eye and Create Unity</h2>
<p>Contrast is making different things definitely different. The headline should be clearly bigger than the body, and the emphasized button clearly bolder than the other buttons. A halfway difference looks less like contrast and more like a mistake. When the contrast is clear, the viewer's eye flows naturally from the strongest element to the weaker ones. If you decide before you start designing on “the one thing that should be seen first on this screen,” where to apply contrast becomes clear.</p>
<p>Repetition is making the same things the same. Keep subheads always the same size and color, photos always the same corner radius, and cards always the same inner padding. As repetition builds up, viewers pick up the rules quickly and can predict what will be where even on a page they haven't seen. That's why repetition matters especially in multi-card card news and product detail pages.</p>
<h2>Grids — Bind Many Elements Into One Order</h2>
<p>When elements multiply or you have to make several pages, a grid helps a lot. A grid is an invisible frame that divides the artboard into columns of equal width or cells of equal size. Just placing elements on the grid's columns makes alignment and spacing fall into place on their own, and even across many pages, things are laid out consistently on the same frame.</p>
<p>For web and app screens, column grids such as 12 columns on desktop, 8 on tablet, and 4 on mobile are common. For a poster or card news, one simple frame with set top-bottom and left-right margins can be enough instead of a column grid. What matters is not building an elaborate grid but sticking to the frame you set to the end.</p>
<p>If you follow a grid and then deliberately let just one element step outside the frame, that element stands out strongly. Because there is a rule, the exception becomes emphasis. Rather than placing things freely from the start, setting up the frame first and breaking it only where needed gives far more stable results.</p>
<h2>How to Place Things Precisely in a Design Tool</h2>
<p>In Opkle Editor, select several elements and use the alignment group in the toolbar to align left, center, or right and top, middle, or bottom, or to distribute horizontal and vertical spacing evenly. When you drag to move, snap lines appear to match other elements or the artboard's edges and center, and turning on the rulers with ⇧⌘R lets you drag out guides from them. If you want to place things exactly by number, type X, Y, W, and H directly into the transform section on the right.</p>
<p>To set up a grid, select an artboard or frame and click Layout Grid + in the inspector. Choose among grid, columns, and rows, then set the count, the gutter, and the margin, and you can toggle visibility with ⌃G. For groups that need consistent spacing, like cards or lists, make them a frame and turn on auto layout, and the spacing between elements and the inner padding are kept by rule, so the spacing doesn't fall apart even when the content changes.</p>
<h2>Fixing One Cluttered Poster</h2>
<p>Principles become clear when you actually apply them. Take an event poster as an example. The title is in the center, the date at the top right, the venue at the bottom left, and the description is scattered in center alignment, with the logo stuffed into leftover space. Each piece looks fine on its own, but the whole is cluttered.</p>
<p>First, set the alignment line. Since the information runs over several lines, set up one vertical line on the left margin and align the title, date, venue, and description all to that line, left-aligned. Next, split them into groups. Date, time, and venue form one group, “when and where,” so gather them close together and leave a wide gap from the description. Then set the contrast. The event name should be seen first, so make the title much bigger than it is now, make the date bold, and demote the description to small and light. Finally, gather the logo and organizer information small on one line at the very bottom.</p>
<p>Not a single element was added or removed, yet with just one alignment line, two or three groups, and a clear difference in size, the poster looks far more orderly. If you have time left, try widening the margin at the artboard's edge a little more. That one adjustment often gives the final polish.</p>
<h2>Layout Is About Setting Rules and Keeping Them</h2>
<p>Being good at layout is less about the ability to imagine showy arrangements and closer to the diligence of setting a few rules and sticking to them to the end. Decide the line to align to, the spacing values, the shapes to repeat, and the grid. Then break those rules only in the one place you truly want to emphasize. When a design looks cluttered, before adding a new element, try realigning the alignment lines and the spacing first.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>Line elements up on invisible lines, and for information-heavy designs, set up a strong vertical line with left alignment.</li>
<li>Keep spacing inside groups narrow and between groups wide, and settle on a few multiples for spacing values.</li>
<li>Make contrast definite and repetition identical. Deciding the one thing to be seen first makes it clear where to apply contrast.</li>
<li>Set up the frame with a grid first, and step outside it only in the one place that needs emphasis.</li>
<li>Use alignment tools, snap lines, guides, layout grids, and auto layout to match things exactly instead of by eye.</li>
</ul>]]></description>
      <category>design</category>
      <pubDate>Tue, 10 Nov 2026 08:21:47 GMT</pubDate>
    </item>
    <item>
      <title>Product Detail Pages That Sell</title>
      <link>https://opkle.app/abstract/blog/design/product-detail-page-design?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/design/product-detail-page-design?lang=en</guid>
      <description><![CDATA[<p>For anyone selling goods online, the product detail page is like the staff in a physical store. Customers can't pick the product up and touch it, so the detail page has to show, explain, and persuade on its behalf. That's why the same product can have very different purchase rates depending on its detail page. It's also why this is one of the designs that people running Smartstore (Naver's online store platform) or their own shop agonize over most, and one of the most costly to outsource.</p>
<p>What makes a detail page hard is its length. Within one long page running from top to bottom, dozens of photos, text blocks, tables, and icons go in, and customers mostly flip through it quickly with their thumbs on phones. More important than a pretty design is a flow matched to where the customer stops, what they read, and where they make up their mind.</p>
<p>In this article, we go through a detail page in order, from flow to design to export.</p>
<p>1. <strong>Planning the flow</strong> — divide sections in the order customers decide to buy.</p>
<p>2. <strong>Mobile-based sizing</strong> — how to match width and text size to phones.</p>
<p>3. <strong>Polishing photos</strong> — how to match the tone and background of product photos.</p>
<p>4. <strong>Making information readable</strong> — how to organize features, specs, and comparisons.</p>
<p>5. <strong>Working and exporting</strong> — how to build in sections and export lightly.</p>
<h2>Plan the Flow in the Order Customers Decide</h2>
<p>For a detail page, settle the flow before you open the design tool. Customers usually go through the sequence “interest, empathy, understanding, confidence, decision” before buying a product. If you divide sections along this order, the worry about what to put where drops considerably.</p>
<p><strong>A commonly used section order</strong></p>
<ul>
<li><strong>First screen</strong> — one photo that shows the product at its best, and one sentence on what this product does. This is where they decide whether to keep looking.</li>
<li><strong>Problem and empathy</strong> — point to the inconvenience customers face so it feels like “something I need.”</li>
<li><strong>Solution and key features</strong> — show how this product solves that inconvenience, in around three features.</li>
<li><strong>Evidence</strong> — show reasons to trust it, such as reviews, certifications, test results, and the making process.</li>
<li><strong>Usage and detailed information</strong> — organize size, material, contents, and how to use with tables and photos.</li>
<li><strong>Guidance</strong> — resolve the last hesitation with shipping, exchange and return policies, and frequently asked questions.</li>
</ul>
<p>More features might seem better, but what customers remember is around three. Rather than listing ten advantages of the product, it's more persuasive to pick the three most important, show them big, and send the rest to a table in the detail information section.</p>
<h2>Set the Size Based on Phones</h2>
<p>Detail pages are mostly read on phones. Recommended widths differ a little by shop, but pages are commonly made at around 860px wide, and on a phone that width shrinks to fit the screen. In other words, the text you see in the design tool becomes nearly half as small on a phone.</p>
<p>That's why text on a detail page needs to be bigger than you'd think. At an 860px width, setting body text at 28px or more and titles at 50px or more reads comfortably on a phone. If you get into the habit of zooming out from time to time while designing and checking at the size it will appear on a phone, you can avoid discovering after you're done that the text is too small. Break lines short as well, so that a sentence finishes within two or three lines on a phone screen.</p>
<h2>Match the Tone and Background of Product Photos</h2>
<p>On a detail page, photos are the biggest tool of persuasion. But if you use photos shot over several days under different lighting as they are, the colors vary even though it's the same product, and trust drops. Just matching the tone of the photos makes the detail page look far more orderly.</p>
<p>In Opkle Editor, correct one photo to the color feeling you want, then store it as an adjustment style in the inspector's Style Settings, and you can apply the same correction to the rest of the photos at once. If you need to cut out just the product cleanly, right-click the photo and choose Convert › Remove Background. Adding a subtle shadow from the Filter section under the product with its background removed gives it a natural feeling, as if it were resting on a white surface. Small stains or dust in a photo can be rubbed out with the healing tool.</p>
<h2>Make Information Readable With Tables and Icons</h2>
<p>If you spell out the detail information section in long text, nobody will read it. Organize information with set categories, such as size, material, contents, and care instructions, into a table. In Opkle Editor, choose Create Table in the toolbar and click the artboard to make a table, and clicking the table again opens the table editing screen to edit its contents, so a table fits naturally into the design.</p>
<p>Key features are easy to read if you make an icon, a short title, and a one- or two-line description into one group and repeat it in the same shape. If you make this group a component, you can reuse it many times by changing only the icon and text, and when you later adjust the look, you only need to fix the one original. If you want to show the difference from competing products, a comparison table placing “other product / this product” side by side communicates much faster than a long explanation.</p>
<h2>Build and Export With One Artboard per Section</h2>
<p>If you make the detail page as one very long artboard, it's awkward to work on and hard to find the spot to fix. If you make one artboard of the same width for each section, such as first screen, problem and empathy, features, evidence, and detailed information, and place them side by side vertically, it becomes easy to edit by section and change the order. When making artboards of the same width, the quickest way is to duplicate the first artboard and change only the height. If you name the artboards in order, like 01_Hero and 02_Empathy, the exported files are organized in order too.</p>
<p>When exporting, choose all artboards in Export at the bottom right and export as images. Sections with many photos should be exported as JPG or WebP, and sections with lots of text and tables as PNG to stay crisp. Uploading in sections lets the page open faster than one giant image and is less likely to hit a shop's image size limit. The estimated file size appears the moment you set options in the image export window, so lower the quality a step or two and stop at the point where you can't see a difference.</p>
<h2>Common Detail Page Mistakes</h2>
<p>If a carefully made detail page doesn't sell as much as you hoped, one of the mistakes below is usually hiding in it.</p>
<p><strong>Things that make an immediate difference when fixed</strong></p>
<ul>
<li><strong>The first screen has only a greeting and a logo</strong> — On the first screen, customers want to know what this product is and what it does for them. Move the brand introduction later, and put a product photo and one key sentence on the first screen.</li>
<li><strong>Too much text inside photos</strong> — An image with long paragraphs is nearly unreadable on a phone. Keep one message per section, and break the text into two or three lines.</li>
<li><strong>Each section has a different design</strong> — If the fonts, colors, and margins change from section to section, it looks like a page made by several people. Set the title, body, and accent colors with paragraph styles and fill styles and use them across all sections.</li>
<li><strong>The real size can't be told</strong> — From photos alone, it's hard to guess a product's size. Add a photo of it in a hand, a photo with a familiar object, or a drawing with the dimensions written in.</li>
<li><strong>Guidance information is missing</strong> — Without shipping times and exchange and return terms, customers hesitate at the last moment. Be sure to include them at the end of the page, even briefly.</li>
</ul>
<p>A detail page isn't a design you finish once and are done with. If there's a question customers often ask, add its answer as one section on the detail page, and when reviews accumulate, replace the evidence section with the new ones. If you've split the artboards by section, you only need to fix the one section that changed and export again.</p>
<h2>A Detail Page Is Writing That Answers Customers' Questions</h2>
<p>A detail page that sells well has a structure that answers the customer's questions in order, rather than flashy effects. What is this? Do I need it? Is it really good? Can I trust it? How do I use it once I get it? What if there's a problem? Write these questions down in order, and make one section answering each. Design is the work of helping those answers read quickly and clearly on a phone.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>Divide sections to match the customer's decision flow: first screen, empathy, solution and features, evidence, detailed information, guidance.</li>
<li>Pages are commonly made at around 860px wide, but look nearly half as small on a phone, so use large text: 28px or more for body and 50px or more for titles.</li>
<li>Match photo tone with adjustment styles, and show the product cleanly with background removal and a subtle shadow.</li>
<li>Make detailed information readable with tables, and repeat key features as icon groups built from components.</li>
<li>Build with one same-width artboard per section, and export photo sections as JPG or WebP and text sections as PNG to keep them light.</li>
</ul>]]></description>
      <category>design</category>
      <pubDate>Tue, 10 Nov 2026 08:21:47 GMT</pubDate>
    </item>
    <item>
      <title>Choosing Fonts and Setting Type — Typography Basics</title>
      <link>https://opkle.app/abstract/blog/design/typography-basics?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/design/typography-basics?lang=en</guid>
      <description><![CDATA[<p>Type takes up more of a design than you might think. The title on a poster, the sentences on card news, the button labels on an app screen, the descriptions on a product detail page: most designs are, in the end, about making text readable. Yet people often spend ages on photos and colors while leaving the type in the default font. If a design looks somehow amateur, the cause is surprisingly often the type rather than the color.</p>
<p>Typography doesn't end with choosing a font. How many fonts to use, how many size steps to have, how much space to leave between lines and between letters, and how long to make a line all change the reading experience. The welcome news is that these decisions have fairly clear standards. Once you know them, polishing just the type lifts a design a notch in orderliness.</p>
<p>In this article, we go through the basics of handling type in design work, in order.</p>
<p>1. <strong>Choosing fonts</strong> — Myeongjo (serif) and Gothic (sans-serif), and how many to mix.</p>
<p>2. <strong>Type hierarchy</strong> — how to create a reading order with size and weight.</p>
<p>3. <strong>Line spacing, letter spacing, and line length</strong> — the spacing that makes Korean comfortable to read.</p>
<p>4. <strong>Handling type in practice</strong> — how to use text boxes and paragraph styles in a design tool.</p>
<p>5. <strong>Outlines and font licenses</strong> — what to take care of before handing off.</p>
<h2>Two Fonts Are Enough</h2>
<p>Korean fonts fall broadly into Myeongjo (serif) and Gothic (sans-serif). Myeongjo has strokes that vary in strength, a legacy of brush calligraphy, giving a calm, literary impression and reading comfortably in long passages on paper. Gothic has even, clean stroke widths that read crisply on screen and suit conveying information and a modern impression. That's why most screen designs today use Gothic as the default.</p>
<p>The most common mistake beginners make is mixing too many fonts. A handwriting font for the title, Myeongjo for the subtitle, Gothic for the body, yet another bold font for emphasis: each may be pretty on its own, but the whole becomes scattered. Two fonts are enough for most designs, and one is often enough. Just changing the weight (Regular, Medium, Bold) within a single font family can create a hierarchy easily.</p>
<p>If you use two fonts, they must be clearly different. Mixing two similar Gothics looks like a mistake rather than intended contrast. Dividing the roles feels natural: a characterful font for the title and a plain, easy-to-read Gothic for the body.</p>
<h2>Create a Reading Order With Size and Weight</h2>
<p>Before reading text from start to finish, people first skim whatever is large and bold. Designing that skimming order is what type hierarchy is. A design with a clear hierarchy tells you what it's about in a few seconds, while one without it leaves you not knowing where to start, so you just pass it by.</p>
<p><strong>Guidelines for building hierarchy</strong></p>
<ul>
<li>Start with about three levels. Title, subtitle, and body can handle most designs.</li>
<li>Make the size differences between levels clear. If body is 16, a subtitle of 20 to 24 and a title of 32 or more are clearly bigger, so they read as hierarchy.</li>
<li>When size alone isn't enough, add weight and color. Setting body in dark gray and the title in a near-black color with a heavy weight increases the contrast.</li>
<li>Use just one method of emphasis. Using bold, color, and underline all at once isn't emphasis but noise.</li>
</ul>
<h2>Line Spacing, Letter Spacing, and Line Length Decide Comfort</h2>
<p>If you've chosen the font and size and the text still looks cramped, suspect the spacing. Hangul is a script of square characters running in dense rows, so reading comfort changes a lot with spacing.</p>
<p>Line spacing is the gap between lines. Body text reads comfortably at about 160 to 170% of the font size, while large, short text like a title should be tightened to about 120 to 130% to look like one block. Give a large title the same line spacing as body text and the gap between lines becomes too wide, so it reads like two separate titles.</p>
<p>Letter spacing is the gap between characters. Large titles look as if they have wider gaps than they really do, so tightening the spacing a little makes them look solid, while small body text suits the default or just a very slight tightening. Conversely, very small text and English capital-letter decoration look crisper with the spacing widened.</p>
<p>Line length matters too. If a line is too long, it's hard to find the start of the next line from the end of the current one, and if it's too short, the eye keeps getting interrupted. For Korean body text, roughly 25 to 40 characters per line is comfortable. Even if the screen is wide, it's better to narrow the text box and keep the line length.</p>
<h2>How to Handle Type in a Design Tool</h2>
<p>In Opkle Editor, there are three ways to write text. Choose Text (T) and click for a single line, or drag to make a text box. Short text like a title is easy to manage as a single line, and long text like a description as a text box. If you want text that follows a line, such as logo lettering that runs around a circle, choose Text on Path and click a path or shape.</p>
<p>Select text and set the font, size, weight, and color in the Text section on the right, and below it, in the Paragraph section, set line spacing, letter spacing, space above and below paragraphs, and alignment. The text box's sizing mode is also chosen in the Paragraph section; for a text box whose content changes often, leaving it at auto height means the text won't get cut off as it grows. Font files you own (ttf, otf) can be dragged onto the canvas or added through Insert → Font File, and then picked directly from the font list.</p>
<p>Once you've set the hierarchy, store it as paragraph styles. If you make title, subtitle, and body into paragraph styles in the inspector's Style Settings, you only need to pick a style for new text, and when you later want to change the body size, fixing just one style changes the body text across the whole design. For text that needs to stand vertically, right-click and choose Vertical Writing.</p>
<h2>Common Type Mistakes</h2>
<p>When working with type, there are mistakes everyone makes at least once. Each looks small, but together they make the whole design feel less polished.</p>
<p><strong>Things that make an immediate difference when fixed</strong></p>
<ul>
<li><strong>Forcibly stretching and squeezing text</strong> — Changing the width-to-height ratio of letters to fit a text box makes the font look distorted. Fitting it with size, letter spacing, and line breaks looks far more natural.</li>
<li><strong>Everything is bold</strong> — If the title, body, and buttons are all bold, weight no longer emphasizes anything. Save bold for one or two places on the screen.</li>
<li><strong>One lone character left at the end of a line</strong> — When a title splits into two lines and only one or two characters remain on the last line, it looks awkward. Set the line break position yourself or change the text box width a little to even out the line lengths.</li>
<li><strong>Text gets lost over a photo</strong> — Thin text over a busy photo can't be read. Place the text on a relatively plain area of the photo, lay a color wash, or add a subtle shadow from the Filter section to lift the text.</li>
<li><strong>Text that's too small</strong> — Zoomed way in within the design tool, small text looks fine, but it's hard to read in the real output. Get in the habit of shrinking the view to actual size to check while working.</li>
</ul>
<h2>Before You Hand It Off — Outlines and Font Licenses</h2>
<p>When you hand a design to someone else or send it to a print shop, the font may not be on their computer. For text that must keep its exact shape, like a logo or a large title, right-click and choose Outline to convert it into shapes (paths), and it will look the same even in an environment without the font. Once converted to outlines you can no longer edit it as text, so it's good to get in the habit of duplicating the original text and hiding it before converting.</p>
<p>Be sure to check the font's usage scope too. Even a free font may allow only personal use, or allow print but not logos or video. For commercial work, it's safer to read the license notes where you downloaded the font first.</p>
<h2>Refine the Type and the Design Comes Into Order</h2>
<p>Typography is less about eye-catching techniques and more about restraint. Two fonts or fewer, three levels of hierarchy, one method of emphasis, spacing matched to the font size. Following just these few makes the same content read far more crisply and credibly. Next time a design looks off somehow, look at the type again before changing the color.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>Keep to two fonts or fewer, and building hierarchy by changing weight within one family looks more orderly.</li>
<li>Start hierarchy with three levels of title, subtitle, and body, and make the size differences between levels clear.</li>
<li>Set body line spacing at 160 to 170% of the font size, tighten large titles to 120 to 130%, and keep a line at about 25 to 40 characters.</li>
<li>Use auto height for text boxes and store repeated text looks as paragraph styles to make editing easy.</li>
<li>Before handing off, convert logos and titles to outlines (keeping a duplicate of the original) and check the font license.</li>
</ul>]]></description>
      <category>design</category>
      <pubDate>Tue, 10 Nov 2026 08:21:47 GMT</pubDate>
    </item>
    <item>
      <title>When AI Operates Your Design Tool — Opkle AI, MCP, Plugins</title>
      <link>https://opkle.app/abstract/blog/design/ai-agents-in-design-tools?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/design/ai-agents-in-design-tools?lang=en</guid>
      <description><![CDATA[<p>Until now, the way AI has entered design has mostly been “making pictures for you.” You describe a scene in words, an image comes out, and you carry that image into a design tool to polish it. Lately, though, a different current has appeared. AI is no longer stopping at making images; it is operating the design tool itself. It resizes artboards, aligns shapes, fixes a whole set of documents at once, and has even started building new features and adding them to the tool.</p>
<p>This change is less about taking designers' work away and more about lifting the repetition and housekeeping off their shoulders. People still decide what to make and what counts as a good result. There is simply one more hand to carry out those decisions. To use that hand well, it helps to first understand how AI connects to a tool.</p>
<p>In this article, we look at three ways AI can work with a design tool, one at a time.</p>
<p>1. <strong>AI inside the tool</strong> — handing work to Opkle AI in plain words.</p>
<p>2. <strong>Connecting your own AI to the tool</strong> — letting an AI such as Claude operate the editor through MCP.</p>
<p>3. <strong>AI that builds features</strong> — having AI create plugins for you, even if you know no code.</p>
<p>4. A summary of <strong>when to use which</strong> of the three.</p>
<p>5. The <strong>judgment that stays with you</strong> in all of these approaches.</p>
<h2>AI Inside the Tool — Handing Work Over in Words</h2>
<p>The closest approach is to hand work to the AI that lives inside the tool. Type what you want into the AI input box at the bottom center of Opkle Editor, and Opkle AI operates the editor directly to help. When you don't know where a feature is, or you have to repeat the same job many times, you can describe the result you want instead of hunting through menus. Requests like “Change the canvas size to 1:1,” “Center the selected objects,” “Merge the selected objects into one,” or “Trace this image into vectors” all work this way. When you click into the input, ready-made sentences appear as chips, so just trying a few gives you a feel for what you can delegate.</p>
<p>Delegating well is a lot like asking a person for help. Select what you want to change first, then make the request, and describe one specific job at a time. Writing the values outright, as in “Font size 32, color #333333,” gives more accurate results than a vague request like “make it prettier.” If you don't like the result, undo with ⌘Z and ask again with different wording. Generating images and turning images into video continue in the same input box, and Opkle AI uses credits for each request.</p>
<h2>Connecting Your Own AI to the Tool — MCP</h2>
<p>The second approach is to connect an AI you already use to the design tool. The connection method used here is MCP (Model Context Protocol). MCP is an agreement that lets an AI call the features of an outside program as “tools,” so any program that honors the agreement can have its features called directly by an AI.</p>
<p>While it is running, the Opkle Editor desktop app opens an MCP connection point inside your own computer. Connect an AI such as Claude Desktop, Claude Code, or Codex to it, and the AI can read and edit the canvas and layout documents of the project you currently have open. The connection details are in the “AI Connection (MCP)” box of the profile window, which opens when you click the logo at the top left of the app. With Claude Desktop, clicking connect brings up an install window and you only press “Install.” With Claude Code, you paste one copied command line into the terminal and you're done. With Codex, you paste the copied settings snippet into your settings file.</p>
<p>Safety is built in too. The connection point opens only inside your own computer, and you need a token to get in. When the AI writes files on your computer, it can use only the folders you have allowed in the app's confirmation window, and you can withdraw that permission at any time. A connected AI bundles multi-step work into a single script, checks the result with a preview, and refines as it goes. It shines especially at jobs that are tedious and slow for a person, like changing the titles of ten posters at once, or loading a folder of photos and placing them one after another into the same frame.</p>
<h2>AI That Builds Features — Plugins</h2>
<p>The third approach is to have the AI build the tool's features themselves. No matter how many features a design tool has, it can't hold every person's repetitive tasks. That's why many tools let you add features through plugins, but until now, making a plugin was a job for people who could code.</p>
<p>In Opkle Editor, once you have connected an AI to the desktop app, you simply describe the feature you want, and the AI builds the plugin, tests it, and places it in the Plugins tab. The fastest way is to tell it three things: what it should attach to, what should come out, and what you want to adjust. You can say, “Make me a plugin that draws a barcode as vectors when I enter an ISBN number, with adjustable bar height,” or “Make me a filter that places my logo at the bottom right of a photo, and let me choose the logo from a file.” If you later find something to improve, just say so, as in “Widen the slider range,” and it will fix it as a new version of the same plugin, with the values you were using kept as they were.</p>
<p>You can share the plugins you make with your team or post them to the plugin market for others, and you can also download plugins other people have made. Default plugins such as a gradient generator, a barcode and QR generator, and charts come built in, with nothing to download. Plugins run in a safe sandbox where they can't reach the internet or do anything that hasn't been permitted, and a plugin downloaded from the market or shared with you brings up an approval window the first time you use it, showing where it came from and what permissions it asks for. A plugin that an AI posts to the market goes up in an unpublished state, so it becomes visible to others only after a person checks its contents and publishes it.</p>
<h2>When to Use Which</h2>
<p>The three approaches don't replace one another. You divide them up by the size and nature of the job.</p>
<p><strong>By use case</strong></p>
<ul>
<li>If you want to change one or two things on the current screen quickly, Opkle AI inside the tool is the closest fit. It also works in a web browser.</li>
<li>If you need to repeat the same job across many documents, or load and organize many files from your computer, your own AI connected through MCP is the right fit.</li>
<li>If you expect to keep doing the same kind of job in the future, it's better to turn it into a plugin. Build it once, and you can use it with a single click, no AI needed.</li>
</ul>
<p>Say you make a weekly card news series. Changing the font size on this week's cards is something you can hand to Opkle AI in words. Swapping the logo on the last three months of cards for a new logo all at once is faster with an AI connected through MCP. And if you add the date and issue number to the bottom of every weekly card in the same style, building a plugin that does it will stay convenient the longest.</p>
<h2>Judgment Stays With People, Even With More Hands</h2>
<p>As AI becomes able to operate tools directly, the center of gravity in design work is shifting little by little. The ability to memorize where menus are and repeat the same job dozens of times matters less, while the ability to decide clearly what to make and judge the result accurately matters more. AI can carry out a request like “Change all the titles to 32” quickly, but it won't judge whether the titles should be 32.</p>
<p>So there are a few things worth keeping in mind when you delegate to AI. Always check the result with your own eyes, and undo it if you don't like it. Back up your project before important work. When you handle other people's faces or copyrighted works, check the permissions first. And rather than using what the AI produces as it is, keep a final step where you choose and refine it by your own standards.</p>
<p>When AI operates a design tool, it ultimately means designers can spend more of their time on judgment. Leave the repetition to the hands, and let people set the direction. When that division of labor works well, AI becomes less a stand-in who draws for you and more a colleague you work alongside.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>AI is now expanding beyond making images toward operating design tools directly.</li>
<li>With Opkle AI inside the tool, you can delegate work in words by selecting the target first and writing the exact values to change.</li>
<li>Connecting your own AI, such as Claude, to the desktop app through MCP lets you hand off repetitive work that spans many documents and files.</li>
<li>Even without knowing code, you can have AI build plugins, and share them or download others' through the market.</li>
<li>Use Opkle AI for the one-off job now, MCP for many documents, and plugins for what you'll keep doing, and leave judgment and final review to people.</li>
</ul>]]></description>
      <category>design</category>
      <pubDate>Tue, 10 Nov 2026 05:26:00 GMT</pubDate>
    </item>
    <item>
      <title>AI Photo Editing — When to Use Each Tool</title>
      <link>https://opkle.app/abstract/blog/design/ai-photo-editing-tools?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/design/ai-photo-editing-tools?lang=en</guid>
      <description><![CDATA[<p>Now that AI has come to photo editing, jobs that once took a skilled retoucher a good while can be done in a few clicks. Cutting out a background, erasing power lines from a shot, extending a cropped landscape, enlarging a small photo: all of it is now quick. But the features have similar names and their uses seem to overlap, so it's easy to be unsure which one your own photo actually needs.</p>
<p>AI photo-editing features answer four broad questions. What do you keep, what do you remove, how do you extend the edges, and how large will you use it? Once you settle those questions, choosing a feature gets much simpler. There is one more distinction worth knowing: some features run on your own computer, while others need a large AI model and run on a server.</p>
<p>In this article, we sort the commonly used AI photo-editing features by what they are for.</p>
<p>1. <strong>Keeping</strong> — choose only the parts you need with background removal and AI selection.</p>
<p>2. <strong>Erasing and filling</strong> — erase or repaint part of a photo with inpainting.</p>
<p>3. <strong>Extending and reshaping</strong> — change a photo's format with outpainting and content-aware scaling.</p>
<p>4. <strong>Enlarging and restoring</strong> — polish quality with upscaling and noise and blur removal.</p>
<p>5. A walk through <strong>how to chain the features in order</strong> on one real job.</p>
<h2>First, a Note — AI on Your Computer and AI on a Server</h2>
<p>Before you use the AI features, it helps to draw one distinction. A good number of Opkle Editor's AI features calculate directly on the computer you're using. Background removal, AI selection, inpainting's “Erase,” noise and blur removal, and ML adjustments fall into this group. Your photo never leaves for an outside server and no credits are used, so you can use them with confidence on personal photos and unreleased work. The first time you use one, you may wait a little while an AI model downloads, but once it's downloaded it runs immediately from then on.</p>
<p>Features that need a large AI model, on the other hand, run on a server and use credits. These include image generation, outpainting, inpainting's “Fill,” and upscaling. You can check your remaining credits in the profile window, which opens when you click the logo at the top left. Neither side is better; they simply serve different purposes. A handy way to remember it: erasing, selecting, and polishing happen on your computer, while drawing something new or enlarging a lot happens on the server.</p>
<p>For the features that run on your computer, processing time can vary with your machine's graphics performance and memory. If you see a message saying memory is low, shrink the photo a little and try again. You can stop a long job with Esc.</p>
<h2>Keeping — Background Removal and AI Selection</h2>
<p>When you want to cut out a product photo cleanly or composite a portrait onto another background, background removal is the first feature you'll reach for. Right-click the photo and choose Convert › Remove Background, and only the person or object remains while the background is stripped away. It used to mean tracing the outline with a pen for quite a while.</p>
<p>When you want to select only a certain part rather than the whole background, use AI selection. Select Subject finds the main subject and selects it when you click the photo. Select Object previews the object under your cursor, and you can adjust its range with the wheel before selecting. Select Sky and Select Depth are in the same group. Because painting and adjustments apply only inside the selected area, it becomes easy to brighten just a person while leaving the background alone, or make only the sky bluer.</p>
<p>When you use an image with the background removed, think about the export format too. To keep the transparent background, export as PNG or WebP; if you export as JPG, the empty areas get filled with another color. For places that need a white background, like a sales page, it's tidy to place a white rectangle underneath after removing the background and set the margin you want at the same time.</p>
<h2>Erasing and Filling — Inpainting</h2>
<p>When you want to erase something that would be better gone, like power lines, passersby, or a stain on the floor, use AI inpainting. Choose AI Inpainting from the AI group in the toolbar, paint over the part you want to remove, and release. It fills the area naturally to match the surrounding colors and texture. Besides the brush, you can also pick the spot to fix precisely with the lasso or the pen.</p>
<p>Inpainting comes in two modes. Right-click the canvas to switch between “Erase” and “Fill.” Erase removes the traces to match their surroundings and runs on your computer. Fill describes in words what should go in the painted area and draws it anew, which you use when adding something that wasn't in the photo, such as putting a vase on an empty table. Fill is also useful when you want to redraw only a small part, like awkward fingers or lettering in an AI-generated image.</p>
<p>For small blemishes, you don't even need AI. Rubbing with the healing tool erases them to match the surrounding texture, and on a background with a repeating pattern, the stamp, which copies pixels from another spot, tends to look more natural. Use AI for large things and your hands for small ones, and the result comes out cleaner.</p>
<h2>Extending and Reshaping — Outpainting and Content-Aware Scaling</h2>
<p>Sometimes you need to use a vertical photo on a horizontal banner. Crop it to fit and the important parts get cut off; leave it as it is and both sides are empty. This is where outpainting comes in. First widen the artboard to the size you want with Crop (C), then select a photo smaller than the canvas and choose Outpainting in the AI group. The AI extends the picture beyond its edges and fills the whole artboard.</p>
<p>If you only need to change the format slightly, content-aware scaling may be a better fit. It keeps people and objects intact and shrinks or stretches only the flat parts, such as sky or floor, to change the proportions naturally, and it runs on your computer. If there's a lot of space to draw anew, choose outpainting; if you only need to nudge the proportions, choose content-aware scaling.</p>
<h2>Enlarging and Restoring — Upscaling and Noise and Blur Removal</h2>
<p>When you have to print a small photo or show it on a big screen, simply stretching the size makes it blurry. Upscaling enlarges a photo while making it sharper, and you can use it from Upscaling in the AI group or from Convert › Upscale in the photo's right-click menu. Upscaling can be applied to video, too.</p>
<p>If the problem is the image quality itself rather than the size, a different tool fits. Grainy noise and compression artifacts can be revived with AI noise removal, and photos blurred by shake with AI blur removal. For an old black-and-white photo, you can try B&amp;W Colorization in the filter window's AI group, and if you want to add background blur like a phone's portrait mode to a phone photo, Lens Blur is there too. The usual best order is “restore, then enlarge.” Clean up the noise first and then enlarge, so the noise doesn't get enlarged along with everything else.</p>
<h2>Chaining Them Into One Job</h2>
<p>The features show their strength when chained in order, more than when used alone. Take the example of turning an old vertical product photo shot on a phone into a horizontal sales banner.</p>
<p>First, clean up the noise and blur to restore the quality. Next, widen the artboard to banner size and extend both sides with outpainting. Erase the power lines reflected in the photo and the stain on the floor with inpainting's Erase. If you want the product a bit brighter, select only the product with Select Subject and raise the brightness. Finally, if you plan to use it in print as well, enlarge it with upscaling. Put your logo and copy on top and export, and the banner is done.</p>
<p>In this flow, each feature answers just one question. Restore the quality? Extend? Erase? Select? Enlarge? Put the questions in order and the work unfolds in order.</p>
<h2>AI Editing Is Still a Matter of Judgment</h2>
<p>AI photo-editing features greatly cut down work that used to take a lot of hands-on effort, but people still decide what to erase and what to keep. Whether a product photo with its background removed suits the tone of the sales page, or whether a landscape extended by outpainting spoils the mood of the original, is not something AI can judge for you. And when you edit a photo that contains someone else's face or copyrighted work, or use it as a reference image, check the usage rights first.</p>
<p>Think of the question before the feature's name. Keep it, erase it, extend it, enlarge it? Once the question is clear, the feature to choose is clear too, and AI becomes a hand that carries out that judgment quickly.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>AI photo editing is easier to choose from when you sort it into four questions: keep, erase, extend, enlarge.</li>
<li>Background removal, AI selection, inpainting's Erase, and noise removal run on your computer, while Fill, outpainting, and upscaling run on a server AI.</li>
<li>With inpainting, use “Erase” to remove traces and “Fill” to draw in new content, and clean up small blemishes with healing.</li>
<li>When changing format, outpainting suits a large space to draw anew, and content-aware scaling suits a simple ratio adjustment.</li>
<li>The features show their strength when chained in order, as in “restore, extend, erase, select, enlarge,” and when someone else's face or copyrighted work is involved, check permissions first.</li>
</ul>]]></description>
      <category>design</category>
      <pubDate>Tue, 10 Nov 2026 05:26:00 GMT</pubDate>
    </item>
    <item>
      <title>Exporting Images for the Web vs. for Print</title>
      <link>https://opkle.app/abstract/blog/design/export-for-web-and-print?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/design/export-for-web-and-print?lang=en</guid>
      <description><![CDATA[<p>The most deflating moment after finishing a design is the export. A logo that looked crisp on screen turns blurry once it's on the website. A poster that looked lovely on your monitor comes back from the print shop with muddy colors or trimmed edges. And the opposite is common too: an image exported far too large for the web slows the page down.</p>
<p>Exporting is hard because the same design needs different things depending on where it ends up. The web wants light and sharp, print needs enough resolution and the exact size, and an icon for a developer has to be in a format that can be edited again. So exporting is better seen not as one last button but as a final design step: thinking about where the result will arrive.</p>
<p>In this article, we go over how to choose format, size, and resolution depending on the use.</p>
<p>1. <strong>Image formats</strong> — what PNG, JPG, WebP, and SVG each suit.</p>
<p>2. <strong>Exporting for the web</strong> — balancing sharpness against file size.</p>
<p>3. <strong>Exporting for print</strong> — handling resolution, PDF, and page format.</p>
<p>4. <strong>Repeated exports</strong> — saving settings per layer to export everything at once.</p>
<p>5. A <strong>checklist</strong> worth running before you export.</p>
<h2>Start With the Format — PNG, JPG, WebP, SVG</h2>
<p>Image formats fall into two broad families: PNG, JPG, and WebP, which store pixels, and SVG, which stores a description of the shapes.</p>
<p><strong>What each format is for</strong></p>
<ul>
<li><strong>PNG</strong> keeps quality intact and supports transparent backgrounds. It suits logos, icons, text-heavy images, and product photos with the background removed, though photos can get large.</li>
<li><strong>JPG</strong> stores color-rich images such as photos at a light size. It doesn't support transparent backgrounds, so use it for photos that need a background.</li>
<li><strong>WebP</strong> is a format made for the web; at similar quality it is lighter than JPG or PNG, and it supports transparent backgrounds too. It's worth considering first for images going on a website.</li>
<li><strong>SVG</strong> is a vector format, so it stays sharp at any size and its file size is small. It suits logos and icons on websites and graphics you hand to developers.</li>
</ul>
<p>If you need a transparent background, choose PNG or WebP. JPG doesn't support transparency, so an image with its background removed, exported as JPG, has its empty areas filled with another color.</p>
<p>If you're unsure which format to choose, look first at “what's in it.” If a photo is the star, JPG or WebP. If lines and text need to be crisp, PNG. If it has to be editable again, or used somewhere the size keeps changing, SVG. When a text-heavy card news image is exported as JPG, the edges around the letters tend to look smudged, and just switching to PNG makes it much crisper.</p>
<h2>For the Web, It's a Balance of Sharp and Light</h2>
<p>An image going on the web has to satisfy two things at once. It must be sharp on screen, and light enough not to slow the page. Today's phone and laptop screens pack their pixels densely, so you need to export at about twice the displayed size to look sharp. If an image will show at 400px on screen, you export it at 800px.</p>
<p>In Opkle Editor, click Export at the bottom right to choose an export method. If you need an image to put straight on the web, the optimized image is the easiest: just pick a format and it makes the long side 1980px. If you want to set format, quality, size, and background yourself, choose Image. Size is set by a scale from 0.5x to 4x or by the long side's length, and the resulting size and estimated file size appear the moment you set it.</p>
<p>The easiest way to reduce file size is to lower the quality a little. With photos, a slight drop in quality is hard to notice by eye, yet the file size often shrinks a lot. Watching the estimated size, lower the quality a step or two and stop at the point where you can't see a difference on screen. The lighter the image, the faster the page opens, and the fewer visitors give up waiting and leave.</p>
<h2>For Print, It's Resolution, Size, and PDF</h2>
<p>Print follows different rules from the screen. A screen describes size in pixel counts, but print describes it in actual length and resolution. A common standard in print is 300 to 350 DPI, meaning 300 to 350 dots per inch so that it looks sharp even up close. That's why the same image needs more pixels the larger it will be printed.</p>
<p>If you're handing images to a print shop, set the resolution marker (DPI) to 300 or 350 in the image export window. For document-style print, exporting as PDF is the safer choice. Each artboard becomes one page, and you can choose between viewer and print versions. Getting the page format right from the start matters too. The artboard size presets include Korean book trim sizes such as Singukpan, Gukpan, and 46-pan, along with A and B paper sizes, so you can pick the right size for the printed piece without calculating.</p>
<p>The most common print accident is at the edges. Anything that extends past the artboard won't make it into the result, so before exporting, be sure that text and logos that must not be cut off have enough room inside the artboard. Colors on screen and printed colors can look a little different, so for an important print job, it's wise to get a proof first before the real run. If you need to print a small photo large, enlarging it beforehand with AI upscaling is another option.</p>
<h2>Turn Repeated Exports Into Rules</h2>
<p>A design is never finished in one go. If every time you edit you have to export the icon as SVG, the banner as PNG at 2x, and the thumbnail as JPG, one by one, that alone becomes a big job. In that case, save export settings for each layer.</p>
<p>Select a layer and click Export + at the bottom of the inspector, or choose Settings › Export from the right-click menu, then set the format (PNG, JPG, WebP, SVG) and the scale. You can also add several settings to one layer, so you can get the same logo as SVG and PNG at 2x at the same time. Once saved this way, a single ⇧⌘E exports everything you've set up at once. The layer name also becomes the file name, so naming layers clearly makes things easier for whoever receives them.</p>
<p>If you have several artboards, you can choose to export only the current one, all of them, or the ones you've selected, and multiple files are bundled into one zip. If you want each layer separately, choose PNG Layers, and for animated designs, choose MP4 video.</p>
<h2>What to Check Before Exporting</h2>
<p>Finally, here is a checklist worth a quick glance before you click export. It takes only a few seconds and saves you a lot of the trouble of exporting and sending again.</p>
<p><strong>Export checklist</strong></p>
<ul>
<li>Where will this image be used? First decide whether it is for the web, print, or developer handoff.</li>
<li>At what size will it appear there? Use twice the displayed size for the web, and the actual size at 300 to 350 DPI for print.</li>
<li>Does the background need to be transparent? If so, PNG or WebP.</li>
<li>Are the elements that must not be cut off inside the artboard? Whatever is outside the artboard won't be in the result.</li>
<li>Do the fonts display properly? For an SVG or PDF that will be opened in another environment, open the output once to check.</li>
<li>Is the file name easy to recognize? Tidy up the layer names so the recipient can tell right away what each file is.</li>
</ul>
<h2>Exporting Is Design for the Recipient</h2>
<p>A good export starts with thinking of the recipient. A visitor to a website wants an image that opens quickly, a print shop wants the exact size and resolution, and a developer wants an editable format and clear names. Handing the same design to each in the form that suits them is the essence of exporting.</p>
<p>Before you export, keep three questions in mind. Where will this image be used? At what size will it appear there? What will the recipient do with it? Answer those, and the format, size, and resolution fall into place naturally.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>Exporting is not a last button but a final design step: thinking about where the result will arrive.</li>
<li>PNG or WebP when you need transparency, JPG or WebP for light photos, SVG for logos and icons, and PNG keeps text-heavy images crisp.</li>
<li>For the web, export at about twice the displayed size and keep it light by adjusting quality while watching the estimated file size.</li>
<li>For print, handle 300 to 350 DPI, the exact page format, and PDF, and check that elements that must not be cut off are inside the artboard.</li>
<li>Save export settings per layer, and a single ⇧⌘E finishes your repeated exports.</li>
</ul>]]></description>
      <category>design</category>
      <pubDate>Tue, 10 Nov 2026 05:26:00 GMT</pubDate>
    </item>
    <item>
      <title>Figma or Adobe — Choosing a Graphic Design Tool</title>
      <link>https://opkle.app/abstract/blog/design/graphic-design-tools-figma-adobe?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/design/graphic-design-tools-figma-adobe?lang=en</guid>
      <description><![CDATA[<p>When you set out to choose a graphic design tool, two names usually come to mind first. One is Adobe, which has long led photography, illustration, and editorial design. The other is Figma, which popularized designing screens together with others in the browser. Whether you've just started learning design or have worked in it for years, you've probably wavered between these two at least once.</p>
<p>But choosing a tool isn't about deciding “which one is better.” Each tool is good at different things, with a different background and a different way of working. The best tool for someone who works deeply with photos, someone who designs app screens, and someone who makes books and posters will naturally differ. So when comparing tools, it's better to think first about “where does my work start and where does it end” than to read through feature lists.</p>
<p>In this article, we look at what the best-known graphic design tools are strong at and what to use as your criteria when choosing.</p>
<p>1. What <strong>Adobe's</strong> Photoshop, Illustrator, and InDesign have each been responsible for.</p>
<p>2. How <strong>Figma</strong> changed the way design work is done.</p>
<p>3. The <strong>trouble</strong> that comes from using the two tools together.</p>
<p>4. How <strong>Opkle Editor</strong> answers that trouble.</p>
<h2>Adobe — Specialist Tools That Built Depth in Each Field</h2>
<p>Adobe's design tools have long served as the standard in their fields. Photoshop became synonymous with photo correction, compositing, and retouching, and Illustrator settled in as the basic tool for logos, illustration, and vector graphics. InDesign is the tool that handles pages and text flow with precision in editorial design made of many pages, such as books, magazines, and brochures. It's also a big strength that print shops, publishers, and agencies have worked for a long time with these tools' file formats as the standard.</p>
<p>What characterizes Adobe's tools is the depth in each field. Features built up over a long time show their strength in work that digs deep into one area, such as polishing a single photo pixel by pixel, managing print colors precisely, or setting the typography of a book of several hundred pages.</p>
<p>But that depth also means the tools are separate. Photos go in Photoshop, logos in Illustrator, books in InDesign, so while finishing one piece of work you move between several apps, passing files back and forth. And since around 2013, Adobe has moved from buying a tool once and using it indefinitely to a subscription model with monthly or yearly fees. The more apps you need, the wider the subscription grows, and if you stop subscribing, it becomes hard to keep using the tools.</p>
<h2>Figma — Designing Screens Together</h2>
<p>Figma changed the way design tools work in a big way. It opens in the browser with no installation, and many people can view and edit the same file at once. The sight of planners and developers looking at a designer's screens through the same link and leaving comments right away has become something like the default of design collaboration since Figma.</p>
<p>Figma is especially strong in app and web screen design. It lets you build screens that don't fall apart when content changes, using frames and auto layout, manage repeated buttons and cards from a single original with components, and gather these into a design system. For service design, where screens grow to dozens or hundreds, this structure is a big help.</p>
<p>On the other hand, Figma is a tool focused on screen design, so deep photo correction, painting pixels directly, and editorial design for print often get help from other tools. In the end, a flow emerges in which photos are polished in Photoshop and brought into Figma. Figma also has a free plan with limited features, but using it with a team or expanding its features usually means a subscription with monthly fees per person.</p>
<h2>The Trouble With Using Both Together</h2>
<p>In real work, people often mix several tools rather than using just one. Screens are designed in Figma, the photos that go in them are corrected in Photoshop, the logo is polished in Illustrator, and a brochure for the same brand is made in InDesign. It's a flow that arose naturally because each tool is strong in its own field, but it brings a few troubles.</p>
<p><strong>Troubles when moving between tools</strong></p>
<ul>
<li>Between passing files back and forth, layers get merged or text hardens into an image, making it hard to edit again.</li>
<li>Shortcuts and concepts differ slightly from tool to tool, so your hands slow down every time they switch tools.</li>
<li>Managing the same colors, fonts, and parts separately in each tool makes them easy to drift apart.</li>
<li>The more tools you need, the more the monthly subscription fees grow along with them.</li>
</ul>
<p>The core of the trouble comes down to one thing: the work needed to finish a single piece is not connected in one place but scattered across several tools. Each tool may be excellent, but time and money leak out of the gaps between them.</p>
<h2>Opkle Editor — Scattered Work on One Screen</h2>
<p>Opkle Editor is a graphic design tool built to reduce those gaps. Illustration work like vector shapes, the pen, and pathfinder, photo correction like levels, curves, and layer styles, and pixel editing like brushes and retouching all work together on the same canvas. Placing a logo and live text right on top of a corrected photo, building app screens with frames, auto layout, and components, and even adding animation and exporting to video all continue within one app. Multi-page output such as books and printed pieces is handled in the layout section of the same project and exported as PDF and EPUB.</p>
<p>It also takes care of people coming from other tools. Its shortcuts follow Figma's, and features with names you already know, like frames, auto layout, components, layer styles, and adjustment layers, sit in similar places. You can bring in the files you've been using as they are. Photoshop PSDs open with their layers intact, Illustrator files and PDFs spread out as artboards page by page, and Figma files come in with frames as artboards and with components and instances still linked. InDesign documents come in with pages and text flow when moved over as IDML. Finished work can be exported as PNG, JPG, WebP, and SVG images, PDF, and MP4 video, and you can hand it back as a PSD to a colleague who uses Photoshop.</p>
<p>AI is built into the tool as well. Features like background removal, AI selection, and noise removal run on your own computer, while larger jobs such as image generation and upscaling use credits. Describe what you want in words and Opkle AI operates the editor directly, and in the desktop app you can connect your own AI, such as Claude, through MCP to hand off repetitive work or have it build the plugins you need.</p>
<h2>And Opkle Editor Doesn't Even Have a Subscription</h2>
<p>The question that remains to the end when comparing tools is, in the end, cost. Adobe offers deep tools for each field, and Figma offers a way of designing screens together, both by subscription. Both are good tools, but the more tools your work needs, the more the monthly cost grows, and the worry remains that the moment you stop subscribing, it becomes hard to continue the work you've built up.</p>
<p>Opkle Editor gives a different answer here. It handles photos, vectors, screen design, and motion in one app, and there is no subscription to use the tool. Credits are used only for features that take real heavy computation, like the server AI. Your work is saved on the device you're using, and you can export the whole project as a single .opkle file to keep it or continue as is on another device. Even without paying a monthly fee, your work stays in your hands.</p>
<p>The criteria for a good tool differ from person to person. If you need to dig very deep into one field, a specialist tool for that field may be right, and if a large team needs to work on the same screens in real time, a collaboration-focused tool may fit. But if you want to finish correcting photos, placing logos, building screens, and adding motion and exporting in one place, and to use all of it without a subscription, Opkle Editor is well worth opening first. Just dragging in one of the files you've been using will let you feel the difference.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>When choosing a graphic design tool, look first at where your work starts and ends, rather than which one is “better.”</li>
<li>Adobe built depth in each field with Photoshop, Illustrator, and InDesign, but the tools are separate and used by subscription.</li>
<li>Figma changed browser collaboration and screen design, but photo and print work often needs help from other tools, and team features are by subscription.</li>
<li>Mixing several tools creates gaps in file transfer, shortcuts, style management, and subscription costs.</li>
<li>Opkle Editor connects photos, vectors, screen design, and motion on one screen, opens the files you already use, and above all has no subscription.</li>
</ul>]]></description>
      <category>design</category>
      <pubDate>Tue, 10 Nov 2026 05:26:00 GMT</pubDate>
    </item>
    <item>
      <title>Motion Design Without Code — Animation, Video, 3D Mockups</title>
      <link>https://opkle.app/abstract/blog/design/motion-graphics-without-code?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/design/motion-graphics-without-code?lang=en</guid>
      <description><![CDATA[<p>The same design stands out far more when it moves. A social post that stops a scrolling thumb, a book cover slowly rotating at the top of a sales page, a short intro video where a logo appears one letter at a time: all of these work that way. Yet motion graphics still feels like something you'd have to learn a separate professional video tool for, and animated design on the web seems like something you can only make if you know code.</p>
<p>Motion is made of simpler elements than you might think: when something appears, where it moves, how much it grows or shrinks, and when it disappears. Placing those four things on a timeline is what animation is. If you can handle that time inside the design tool, you can add motion right where you made the static design. Just not having to move the file to a video tool and set everything up again makes the work much lighter.</p>
<p>In this article, we look at how to add motion to a design, and show the result in three dimensions, without code or a separate video tool.</p>
<p>1. How to add basic motion quickly with <strong>presets</strong>.</p>
<p>2. How to create the motion you want yourself with <strong>keyframes</strong>.</p>
<p>3. How to bring video and animation together in one scene with the <strong>video editor</strong> and export it as MP4.</p>
<p>4. How to show covers and posters like physical objects with <strong>3D mockups</strong>.</p>
<p>5. A walk through making one short <strong>social video</strong>.</p>
<h2>Start With Presets</h2>
<p>When adding motion for the first time, picking from presets is quickest. In Opkle Editor, select the shape, text, or picture you want to animate and click Animation Settings in the Animation section on the right, and the animation window opens. Hundreds of motions are ready, from basics such as fade in, up, zoom in, bounce, shake, pulse, and spin to entrance, exit, and emphasis families, and they apply the moment you click.</p>
<p>Set the length with Duration and choose in Playback whether it plays once, goes back and forth, or repeats endlessly, and a basic animation is done. You can check it right away with the play button under the preview, and after closing the window, use Play in the inspector to watch the whole motion on the artboard.</p>
<p>If there's one tip for choosing presets, it's to use motions from the same family with slight time offsets rather than giving every element a different motion. The title floats up first, then the subtitle 0.2 seconds later, then the button 0.2 seconds after that in the same way, and the whole screen moves with one rhythm. More motion isn't better; the clearer the order the eye will follow, the better.</p>
<p>The family names of entrance, exit, and emphasis also tell you what each is for. Use the entrance family when first showing something, the exit family just before the scene changes, and the emphasis family, such as pulse or shake, for a button or price that needs to catch the eye while it stays on screen. It's best to have just one emphasis per screen. If several elements are emphasized at once, nothing is emphasized.</p>
<h2>Create the Motion You Want With Keyframes</h2>
<p>Motions that aren't in the presets are made with keyframes. A keyframe is a point you place on the timeline. Put points between 0% and 100%, set values such as opacity, position, rotation, size, and skew at each point, and the tool connects them smoothly in between. You can even change filter values like blur, brightness, contrast, and saturation, as well as fill and text colors, so you can create effects like a logo color slowly changing or a background going from blurry to sharp.</p>
<p>What determines the feel of a motion is its sense of speed. Even over the same distance, going at one speed from start to end looks mechanical, while starting slowly and stopping slowly looks smooth. You can choose this sense of speed (ease) in Motion Style, and you can also draw the path an element travels with a motion path. In the timeline at the top, you can see each element's timing at a glance and attach the next motion.</p>
<p>Rather than placing keyframes one by one from scratch, the easiest route to the motion you want is to start from a similar preset and then adjust values a little at a time in the keyframes.</p>
<h2>Edit With Video and Export as MP4</h2>
<p>Animated design becomes far more useful when it meets video. Laying captions and a logo over a product video, or slipping an animated title between short clips, are examples. Click Video Editor in the inspector and the same screen switches to video mode. A timeline appears at the bottom with one track per layer, so you can watch video and animation together and fit them into one scene.</p>
<p>Drag video files (MP4, WebM) onto the canvas or add them with Insert, and you can apply filters and adjustments like a photo, or trim them. When the scene is finished, choose MP4 file in Export at the bottom right and it's made into a video with a long side of 1920px. That's a size well suited to animated covers, promo videos, and short social content.</p>
<p>If you want to reuse the motion you made elsewhere, you can save just the animation settings and later load them as an animation file on another canvas. Use one well-made entrance effect the same way across a whole series, and the brand's rhythm stays intact as the content grows.</p>
<h2>Show Your Work Like a Real Object With 3D Mockups</h2>
<p>A book cover, poster, or package design conveys a very different feeling when shown as a flat image versus as a physical object. That's why on a sales page or in a portfolio, a book sitting on a desk looks far more convincing than a single flat cover.</p>
<p>In Opkle, you can create a new 3D from the 3D row on the project screen and open the 3D editor. Wrap your own cover or poster design onto a 3D model like a book or poster, set the lighting and camera angle, and make a mockup image that looks real. Because editing the cover and re-wrapping it onto the mockup continue within the same project, the hassle of rebuilding the mockup every time you edit the design is reduced too.</p>
<p>If you want to place a design at an angle onto a sign or screen in a photo, you can also try Warp's perspective transform. Even in a scene with no 3D model, you can lay a design on naturally and make a simple mockup quickly.</p>
<h2>Making One 15-Second Social Video</h2>
<p>Running through the flow once makes it clear where each feature is used. Take a 15-second vertical video announcing a new book as the example.</p>
<p>First, make the artboard in a 9:16 vertical ratio. The artboard size presets include Instagram and mobile ratios, so there's no need to calculate numbers. Put a short video clip in the background and lay the book image made with the 3D mockup over it. Apply the zoom-in preset to the book, the float-up preset to the title text 0.3 seconds later, and the same preset to the publication date and price another 0.3 seconds later. For the last few seconds, give the pulse emphasis only to the “Meet it now” button.</p>
<p>In the video editor, watch the timeline and match the timing of the background video and the text's entrances, then export as MP4 in Export, and it's done. Without moving between a video tool and a design tool, the promo video is finished within the same project where you made the cover. If the cover design changes, just re-wrap the mockup and export the video again.</p>
<h2>Motion Follows the Grammar of Design</h2>
<p>The most common mistake in animated design is letting the motion get ahead of the design. If every element pops up, spins, and sparkles at once, you can no longer tell what to look at. Just as hierarchy matters in static design, motion needs order and emphasis too. The most important thing should move first and most clearly, and the rest should support it.</p>
<p>Being able to make motion without code means designers can set that order and emphasis themselves. Once you've gone through the flow of starting with presets, refining with keyframes, matching with video, and finishing with a 3D mockup, you'll naturally come to feel that motion is, in the end, part of design.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>Animation is placing “when it appears, where it moves, how much it changes, and when it disappears” on a timeline.</li>
<li>Start with presets, add time offsets, and keep to one emphasis per screen, and a little motion still creates rhythm.</li>
<li>Keyframes and ease let you refine motions that aren't in the presets.</li>
<li>In the video editor, fit video and animation into one scene, and export as MP4 for social media and promotion.</li>
<li>Showing covers and posters like physical objects with 3D mockups and perspective transform lets you finish even the promo video within one project.</li>
</ul>]]></description>
      <category>design</category>
      <pubDate>Tue, 10 Nov 2026 05:26:00 GMT</pubDate>
    </item>
    <item>
      <title>Switching From Figma, Illustrator, or InDesign</title>
      <link>https://opkle.app/abstract/blog/design/moving-from-figma-illustrator-indesign?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/design/moving-from-figma-illustrator-indesign?lang=en</guid>
      <description><![CDATA[<p>The moment people switch design tools usually starts with discomfort. The subscription fee has become a burden, moving between several tools has worn you out, or your team's way of working has changed. But once you actually open the new tool, other worries come first. What if the shortcuts your hands know don't work? Will my old files open? Will I wander around not knowing where the same features are?</p>
<p>Moving tools is less about learning something new from scratch and more about putting concepts you already know in a new place. Concepts like artboards and frames, layers and components, the pen and pathfinder don't change much from tool to tool. Only the names and locations differ a little. So what you need when switching isn't a mindset of learning everything over, but a map: one that tells you what moved where.</p>
<p>In this article, we pair up things worth knowing, tool by tool, for people coming to Opkle Editor from Figma, Illustrator, or InDesign.</p>
<p>1. Where the frames, auto layout, and components you used in <strong>Figma</strong> are.</p>
<p>2. Where to find <strong>Illustrator's</strong> pen, pathfinder, and stroke panel.</p>
<p>3. What comes along when you bring over <strong>InDesign</strong> documents.</p>
<p>4. <strong>Tips for wandering less</strong> in the first few days and <strong>an order for moving over</strong>.</p>
<h2>If You Used Figma — Frames and Components Stay the Same</h2>
<p>What people coming from Figma will welcome most is the shortcuts. Opkle Editor follows Figma's shortcut scheme, so most of the time you can press the keys as you always did and they work. Quick Actions is ⌘/ just as in Figma.</p>
<p>Make frames with the artboard and frame tool (A · F), or wrap elements you've already drawn into a frame with ⌥⌘G. When you select a frame, clipping, auto layout settings, and layout grids appear in the inspector, and ⇧A turns on auto layout directly. Constraints are in the inspector's constraint settings. Make components with ⌥⌘K and detach them with ⌥⌘B, and take the components you've made from the Assets window. Color styles are the fill styles in the Fill section, and you can also make color variables with two values, light and dark.</p>
<p>You can bring over your Figma files too. When you open a Figma file, top-level frames come in as artboards, with components and instances still linked to each other. You can also copy elements in Figma and paste them straight into Opkle Editor, which is handy when you want to move only the parts you need rather than the whole file.</p>
<p>Those used to Figma gain something new as well. On the same canvas where you did screen design, you can deeply correct photos, paint pixels directly, add animation, and export to video. The process of polishing photos in another tool and bringing them into a mockup comes inside one screen.</p>
<h2>If You Used Illustrator — Artboards Stay Artboards</h2>
<p>Illustrator's artboards are simply called artboards in Opkle Editor too, and the same idea holds: you can place several artboards of different sizes on one canvas and work on them together. The pen tool is Path (P), and for direct selection, select a path and press Enter or use the node selection tool. Dragging the handles that extend from points to refine curves works just as you're used to.</p>
<p>For pathfinder, choose subtract, intersect, or unite from the group of the same name in the toolbar, while offset path, simplify, average, and join are gathered in the path handling group. Blend and repeat are in the pathfinder group, and transforms such as perspective and puppet are in Warp. What you did in the stroke panel, such as end caps, corners, dashes, and arrowheads, is done in the stroke options window, and the eyedropper you used to carry a look to another element is replaced by the style picker or ⌥⌘C · ⌥⌘V. Image Trace is the vector tracing that appears in the inspector when you select a photo.</p>
<p>Drag an Illustrator file (.ai) onto the canvas and one artboard is made for each page, so even multi-page documents spread out as they are. SVG and PDF come in the same way, and SVG opens not as a picture but as shapes you can edit one by one. You can also paste graphics copied from Illustrator or Keynote, so for moving small pieces you don't even need to open the file.</p>
<h2>If You Used InDesign — Pages and Text Flow Come Along</h2>
<p>If you've been making books, magazines, or brochures in InDesign, Opkle's layout module takes over that role. Save an InDesign document as IDML and open it, and the pages, text boxes, and the text flow running through multiple boxes all come along. Because the links between text boxes stay alive, even if you edit a sentence earlier on, the text pushes naturally into the later boxes.</p>
<p>You can export the finished document as PDF and EPUB, which means you can make the print version and the on-screen ebook from the same source. Within the same project, you can move back and forth, handling the graphics for the cover and interior on the canvas and the page arrangement in the layout, which reduces the trouble of managing graphics and editorial design separately. When setting artboard sizes, you can also pick Korean book trim sizes such as Singukpan, Gukpan, and 46-pan directly from the presets.</p>
<h2>Tips for Wandering Less in the First Few Days</h2>
<p>The fastest way to get used to a new tool isn't memorizing every menu but getting a few ways of finding your way into your hands.</p>
<p><strong>Ways worth remembering</strong></p>
<ul>
<li>When you don't know what to do, try right-clicking that spot. Most features are gathered in the right-click menu.</li>
<li>For a command whose name you know, type just a few letters in Quick Actions, opened with ⌘/, and run it right away. Each row shows its shortcut too, so it naturally gets into your hands.</li>
<li>Move the view by holding Space and dragging, and gather all artboards onto one screen with ⇧1.</li>
<li>Settings like whether the wheel zooms or snapping is on can be adjusted to suit you in Canvas Settings in the profile window, which opens when you click the logo at the top left.</li>
</ul>
<p>Canvas settings matter more than you'd think. Depending on whether you mainly use a trackpad or a mouse, changing just the wheel behavior changes how natural the tool feels in your hands. If you first set the panning method you were used to in your old tool, the awkwardness of the first few days eases a lot.</p>
<h2>Setting an Order for Moving Over Brings Peace of Mind</h2>
<p>When switching tools, it's best not to try to move all your work at once. If you move a big project midway, the pressure grows as you chase a deadline in an unfamiliar tool. Instead, try moving the small work first, one piece at a time.</p>
<p><strong>A recommended order</strong></p>
<ul>
<li>First, make one small new piece, for example one social image, from start to finish in the new tool.</li>
<li>Next, open one of your existing files and check that the layers, artboards, and fonts come in properly.</li>
<li>Store the colors, fonts, and parts like buttons you use often again as styles and components.</li>
<li>Once you're comfortable, move your in-progress work over one piece at a time, and back up the project as a .opkle file on important days.</li>
</ul>
<p>Going through this order, you'll naturally pick up where the new tool is the same as the old one and where it differs. At first, it's also a good idea to open your current tool and the new tool side by side and do the same task in both.</p>
<h2>Tools Change, but Design Concepts Remain</h2>
<p>Moving tools doesn't mean throwing away the experience you've built up. The sense of grouping parts with frames, managing repetition with components, refining paths to make shapes, and arranging text so it flows works the same in any tool. What the new tool needs to do is make room to receive that sense.</p>
<p>If the move feels daunting, try opening just one of your old files first. The moment you see the familiar layers, artboards, and text boxes arrive in place, switching tools becomes a much lighter decision than you imagined.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>Moving tools is less about learning anew and more about putting concepts you already know in a new place.</li>
<li>Figma users can use the same style of shortcuts and the same frames, auto layout, and components, and bring work over with Figma files and copy and paste.</li>
<li>Illustrator users can find familiar work in artboards, paths, pathfinder, stroke options, and vector tracing, and .ai files spread out as artboards per page.</li>
<li>InDesign documents moved over as IDML bring pages, text boxes, and text flow, and can be exported as PDF and EPUB.</li>
<li>Learn right-click and the ⌘/ Quick Actions, and move over small work first, and the first few days of wandering shrink a lot.</li>
</ul>]]></description>
      <category>design</category>
      <pubDate>Tue, 10 Nov 2026 05:26:00 GMT</pubDate>
    </item>
    <item>
      <title>The Right Order for Photo Correction</title>
      <link>https://opkle.app/abstract/blog/design/photo-correction-order?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/design/photo-correction-order?lang=en</guid>
      <description><![CDATA[<p>When you're correcting a photo, at some point you get lost. You raise the brightness and the colors look faded, so you raise the saturation; that turns the skin red, so you touch the hue; and then the sky blows out to white, so you bring the brightness back down. The longer you fiddle with sliders, the less sure you are whether it's better than where you started. The more adjustment sections there are, the more often this happens.</p>
<p>Photo correction is often hard not because there are too many features but because there is no order. Correction values affect one another, so depending on what you set first, the same photo can end up completely different. If you keep to the order of getting the overall picture first, sorting out brightness, fixing the color, and adding mood last, the time you spend lost in front of the sliders shrinks a lot.</p>
<p>In this article, we divide photo correction into four stages and look at what to watch for and which tools to use at each one.</p>
<p>1. <strong>Setting it in one go</strong> — get a starting point with auto correction.</p>
<p>2. <strong>Brightness and contrast</strong> — sort out the light with exposure, levels, and curves.</p>
<p>3. <strong>Fixing color</strong> — set the color reference with white balance.</p>
<p>4. <strong>Adding mood</strong> — decide the photo's impression with black and white, LUTs, and filters.</p>
<p>5. Finally, how the order applies <strong>to different types of photos</strong>.</p>
<h2>Decide the Starting Point First</h2>
<p>If you don't know what to touch first, it's a good idea to get a starting point with auto correction. In Opkle Editor, when you select a photo, the adjustment sections run long from top to bottom in the inspector on the right. Choose General or Portrait in ML Correction at the top and click, and the AI looks at the photo and sets color and brightness suitably. You can control how much it applies with Strength, and since this calculation happens on the computer you're using, the photo doesn't leave it. The Auto button in each section also sets that section's values to fit the photo.</p>
<p>You don't need to treat auto correction as the finished result. It's closer to a diagnosis that tells you “where this photo has problems.” If the photo got much brighter after auto correction, the original exposure was lacking, and if the colors changed a lot, the color reference was off. Adjustments are values laid over the original, so you can change them again later or reset to defaults to compare, which means you can try out various values without worry.</p>
<p>It's also worth remembering that the adjustment sections run top to bottom in the order “overall, brightness, color, mood.” Working from the top down naturally follows the order this article describes.</p>
<h2>Sort Out the Light First — Exposure, Levels, Curves</h2>
<p>The first real stage of correction is brightness. Color sits on top of brightness, so if you touch color before brightness is sorted out, things keep drifting. The Basic section handles exposure, highlights, shadows, lightness, contrast, black point, texture, and clarity. Most jobs, like saving a dark photo or recovering the bright parts of a photo whose sky has blown out to white, get solved here.</p>
<p>If you want finer control, try levels and curves. Levels is the tool for setting the darkest point, the brightest point, and the midtones of a photo while watching the histogram. If the histogram is bunched to one side, the photo is dark or bright overall, and if both ends are empty, contrast is lacking. Curves lets you drag a line to shape bright and dark areas separately; make the line a gentle S and the darks get slightly darker and the brights slightly brighter, giving the photo some punch.</p>
<p>The standard at this stage is simple. Check that the most important subject is clearly visible, and that detail remains in both the dark and bright areas. Before the whole frame looking pretty, what should be seen in the photo has to be clear. For a portrait, the face is the standard, and for a product photo, the product's texture is.</p>
<h2>Set the Color Reference — Start With White Balance</h2>
<p>Once the light is sorted, look at color. Photos taken under indoor lighting tend to come out yellowish, and photos taken in shade bluish. In that case, you need to set white balance before touching other colors. In the White Balance section, click with the eyedropper on a spot in the photo that should be gray, such as a white wall or gray clothing, and the color is corrected relative to that spot; you can then fine-tune by moving temperature and tint.</p>
<p>Once the color reference is set, adjust the rest only as much as needed. If you want the whole photo slightly more vivid, use Hue and Saturation; if you want to adjust only a specific color such as red or sky blue, use Selective Color; and if you want to give the darks and brights different color casts, use Color Balance. There's also Color Replace, which changes a color picked with the eyedropper into another color, handy when you only need to change the color of clothing or a prop.</p>
<p><strong>Guidelines when touching color</strong></p>
<ul>
<li>First check that skin tones and whites look natural. If those two look off, the whole photo feels off even when the other colors look good.</li>
<li>Saturation is easy to raise and hard to bring down. It's generally better to stop where it still seems a little short.</li>
<li>Looking at one photo for a long time, your eyes get used to its colors. Compare with the original from time to time to check you haven't gone too far.</li>
</ul>
<h2>Add Mood Last</h2>
<p>By now the photo is already in an “accurate” state. What's left is deciding what impression the photo will give. If you need a strong mood, as with a poster or album cover, you can try Black and White, which sets brightness per color to make a characterful monochrome; Monotone, which tints everything in a single color; and Gradient Map, which turns brightness into a gradient of two or more colors.</p>
<p>If you have a color grading file (.cube), load it in the LUT section and set the strength, and you can add a filter to lay on effects like sepia or halftone, or add noise for film-like grain. The reason the mood stage comes last is that the light and color from the earlier stages must be sorted first for the same LUT to give the intended result. Put mood on an unsorted photo, and the problems aren't hidden; they're emphasized right along with it.</p>
<p>Sometimes you want to treat only part of a photo differently. If you want only the sky bluer or only the person a little brighter, select just that part with Select Sky or Select Subject under pixel selection and then adjust. The correction applies only inside the selected area, so you can emphasize just the spot you want without breaking the balance of the whole photo.</p>
<h2>Applying the Order to Different Types of Photos</h2>
<p>Even with the same order, the stage you put the most effort into changes with the type of photo. Looking at a few cases makes it clearer why the order is useful.</p>
<p><strong>Product photos.</strong> The most important thing is looking the same as the real color. Using white balance to make the white background truly white is the key, and in the brightness stage, bring up the shadows so the product's texture doesn't get mushy. The mood stage is rarely used, or only very lightly. Matching several photos to the same tone is especially important.</p>
<p><strong>Portraits.</strong> Skin tone is the reference. Get your starting point with ML Correction's Portrait mode, make sure in the brightness stage that the face isn't lost in darkness, and in the color stage check that the skin isn't too red or yellow. For small blemishes on the skin, tidying them with the healing tool looks more natural than the adjustment sliders.</p>
<p><strong>Landscapes.</strong> The difference in brightness between sky and ground is the biggest homework. In the brightness stage, lower the highlights to save the clouds in the sky and raise the shadows to save the ground, then add punch with curves. It's also the photo type that leaves the most room to add color feeling in the mood stage.</p>
<h2>Match Several Photos by the Same Rules</h2>
<p>As hard as correcting a single photo well is matching several photos to the same tone. Where photos sit side by side, like a product detail page or a social series, it matters more that they work together than that each one is pretty.</p>
<p>In that case, it's good to match one photo as the reference and then reuse its correction values. Store correction values you like as an adjustment style in Style Settings, and you can give other photos the same color feeling in one go. If you want to apply the same correction to several layers at once, right-click an empty spot in the Layers window and create an adjustment layer. The correction overlays all the layers beneath while the originals stay as they are.</p>
<p>The order of photo correction is, in the end, an order of judgment. See what the problem is, sort out the light, set the color reference, and decide last what story to tell. After going through this order a few times, you'll start to see where a photo needs work before you even touch a slider.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>Photo correction is often hard not because there are many features but because there is no order.</li>
<li>Get a starting point with auto correction, then work in the order brightness, color, mood, and you'll spend less time lost.</li>
<li>Set brightness with exposure, levels, and curves, and set the color reference with white balance, then refine only as much as needed.</li>
<li>The stage to put effort into differs by photo type, such as product, portrait, or landscape, and when handling only a part, correct within the selected area.</li>
<li>Match the tone of several photos by applying the same rules with adjustment styles and adjustment layers.</li>
</ul>]]></description>
      <category>design</category>
      <pubDate>Tue, 10 Nov 2026 05:26:00 GMT</pubDate>
    </item>
    <item>
      <title>How to Open and Keep Editing PSD Files Without Photoshop</title>
      <link>https://opkle.app/abstract/blog/design/psd-without-photoshop?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/design/psd-without-photoshop?lang=en</guid>
      <description><![CDATA[<p>Receiving a PSD file and not having Photoshop is a more common predicament than you'd think. An outsourced designer hands over the original as a PSD, you need to tweak a banner you made a while back, or you have to pick up a file a colleague was working on. Open it in a photo viewer and it shows as a single picture, and you can't change a word or move a layer. In the end you start wondering, “Should I subscribe to Photoshop for just a month?”</p>
<p>A PSD isn't a simple image file. Inside it are layer upon layer of layers, masks, layer styles like shadows and strokes, and adjustment layers that change the colors of the layers below. So “opening” a PSD should mean not just seeing the picture but being able to edit it again with those layers intact. Seeing only the picture and having the layers alive are entirely different things.</p>
<p>In this article, we look at what you can expect, and what you should check, when handling a PSD without Photoshop.</p>
<p>1. First, understand <strong>what's inside a PSD</strong>.</p>
<p>2. Learn <strong>how to open it with layers intact</strong> and what to do after opening.</p>
<p>3. Pair up <strong>the features you used in Photoshop</strong> with where they are now.</p>
<p>4. Follow <strong>a few common edits</strong> through real situations.</p>
<p>5. Go over the ways to <strong>save as PSD again</strong> or export in other formats.</p>
<h2>A PSD Is a Record of Stacked Work</h2>
<p>Most Photoshop work is done by stacking layers. You lay a color wash over a background photo, place text on it, add a shadow to the text, and finally match the overall color feeling with an adjustment layer. A PSD saves this process as it is. So even if it looks like a finished picture, when you open it, which layers were stacked in what order and where things were hidden by masks are all still there.</p>
<p>That record has to stay alive for edits to be easy. Swapping only the background photo, changing only the text color, or brightening only the overall tone takes a few clicks when the layers are alive. If the layers were flattened into one image, though, the same edit becomes nearly as hard as starting over. So when choosing a tool for handling PSDs without Photoshop, the first thing to look at is “how much of the layers come in alive.”</p>
<p>Masks and adjustment layers matter for the same reason. A mask doesn't erase part of a photo but hides it, and an adjustment layer doesn't change the original's colors but lays a correction over them. When these two are alive, you can reveal the hidden part again or change the strength of the correction at any time. This way of editing without harming the original is commonly called non-destructive editing, and whether it carries over when a PSD is opened in another tool determines your freedom to edit.</p>
<h2>Open It With Layers Alive, and Continue Right There</h2>
<p>In Opkle Editor, just drag a PSD file onto the canvas and it comes in with its layers alive. Layer masks, layer styles, and adjustment layers come alive too, so you can continue the work you did in Photoshop in a similar structure. The Layers window on the left lists the layers in the order they're drawn from the front, and you can hide or lock each one with the eye and lock on its row.</p>
<p>After opening, it's good to check the important parts once. If a font is used that isn't on the computer you're using, another font may appear in its place, so drag the font file onto the canvas to add it and then pick it again in the Text section. A file with very complex effects may look slightly different from the original, so for parts that must be exact, like a cover or logo, it's good to get in the habit of comparing them side by side with the original image. If you find a file that looks different from the original, letting the community know helps improve things.</p>
<p>If you have brushes from Photoshop, you can bring in brush files (.abr) as they are. Drag an .abr file onto the canvas and nothing is placed on the canvas; instead it goes into the brush list of the Brush tool. Being able to keep painting with brushes your hand knows makes a bigger difference than you'd expect, especially for people doing illustration or retouching.</p>
<h2>Where Is What You Did in Photoshop?</h2>
<p>Once you've opened a PSD, it's time to find the familiar work. Fortunately, most features with the same names are in similar places.</p>
<p><strong>Layers and adjustments</strong></p>
<ul>
<li>Layers and adjustment layers are handled in the Layers window on the left, and right-clicking an empty spot lets you create an adjustment layer.</li>
<li>Layer styles like shadow, glow, and stroke are in right-click Settings › Layer Styles.</li>
<li>Layer masks are made with Add Mask · Hide All in the Mask group of the photo's right-click menu.</li>
<li>Levels, curves, color balance, channel mixer, and gradient map are in the adjustment sections that appear when you select a photo.</li>
</ul>
<p><strong>Painting and retouching</strong></p>
<ul>
<li>Tools with the same names as brush, eraser, stamp, healing, patch, and dodge and burn are right there.</li>
<li>Selection tools are gathered under Pixel Selection (W), from rectangle, ellipse, and magic wand to Select Subject, Object, and Sky.</li>
<li>The filter gallery and liquify can be found in the toolbar's filter window.</li>
</ul>
<p>The biggest difference is that you can handle vectors and photos together on one screen. In Photoshop, after correcting a photo, you often bring in a logo made in another tool to put on it, but here you can lay shapes drawn with the pen and live text straight onto the corrected photo. Text doesn't harden into an image, so you can change its content and font at any time even after you've finished.</p>
<h2>Common Edits, Done This Way</h2>
<p>Most of the time people open a PSD because “I just want to change a little.” Following a few edits that people make often makes it clearer what it means for the layers to be alive.</p>
<p><strong>Changing only the date on an event banner.</strong> Find the date text layer in the Layers window and select it, press Enter to go into text editing, and change just the numbers. If the font looks different, add the font file and pick it again, as mentioned earlier. The background and shadow stay as they are, so there's no need to remake the whole banner for one date.</p>
<p><strong>Swapping only the background photo for another.</strong> Drag the new photo onto the canvas, move it in the Layers window to just above the original background photo, and hide the original with the eye icon. If the new photo doesn't match the format, select it and press C to crop, or use Canvas Cover in the right-click Resize group to make it cover the artboard with no gaps. The text, color wash, and adjustment layers that sat on top keep working on the new photo as they are.</p>
<p><strong>Changing only the overall tone a little.</strong> If an adjustment layer is alive, just select that layer and change its values, and you're done. If there's no adjustment layer, right-click an empty spot in the Layers window to create a new one and overlay the correction on all the layers beneath it. The original layers aren't touched, so if you don't like it, just delete the adjustment layer.</p>
<h2>Back to PSD, or in a Format That Fits the Use</h2>
<p>Once the edits are done, choose the way out according to where the result will be used. If you need to hand it back to a colleague who uses Photoshop, you can save as PSD. Because the layer structure remains, the recipient can keep working from it too.</p>
<p>For an image going on the web or social media, choose one of PNG, JPG, or WebP in Export at the bottom right. If you need a transparent background, choose PNG or WebP, and if you want to upload a color-rich image like a photo at a light size, choose JPG or WebP. For a file going to a print shop, it's safer to set the resolution marker (DPI) to 300 or 350 or export a print PDF.</p>
<p>Opening a PSD is, in the end, also a way of respecting earlier work. When you can inherit and edit the structure of the layers someone carefully stacked, without crushing them into a single picture, and hand them back, collaboration continues naturally. That flow doesn't have to be broken just because you don't have Photoshop.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>A PSD is not one picture but a record of work stacked from layers, masks, styles, and adjustment layers.</li>
<li>When handling a PSD without Photoshop, first look at how much of the layers come in alive and whether non-destructive editing carries over.</li>
<li>In Opkle Editor, dragging a PSD in opens it with layers alive, and .abr brushes can be brought in as they are.</li>
<li>Common edits like changing a date, swapping a background, and adjusting tone take a few clicks thanks to the live layers.</li>
<li>When the edits are done, save as PSD again or export in a format that fits web or print use.</li>
</ul>]]></description>
      <category>design</category>
      <pubDate>Tue, 10 Nov 2026 05:26:00 GMT</pubDate>
    </item>
    <item>
      <title>Frames, Auto Layout, Components for App Mockups</title>
      <link>https://opkle.app/abstract/blog/design/ui-design-auto-layout-components?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/design/ui-design-auto-layout-components?lang=en</guid>
      <description><![CDATA[<p>When you build app screens or web mockups, you eventually realize you're doing the same thing over and over. One button label gets longer, so you resize the button, then go through ten screens that use it to fix each one the same way. A card gains a line, so you drag the elements below it down one by one. The bigger the project, the more time you spend tidying instead of designing.</p>
<p>This is why UI design tools have the concepts of frames, auto layout, and components. These three are devices for making designs whose shape holds up “even when the content changes.” Setting them up takes a bit of time at first, but the more often a design gets revised, the more time you get back beyond what you put in. And a mockup built with these devices is much easier for a developer to understand once it's handed over, because real apps and websites are built on the same principle: boxes and rules.</p>
<p>In this article, on the assumption that you're building an app screen mockup, we look at what problem each of the three concepts solves, in turn.</p>
<p>1. How to group units like buttons and cards with <strong>frames</strong>.</p>
<p>2. How to make parts that stretch on their own with their content using <strong>auto layout</strong>.</p>
<p>3. How to manage repeated parts from a single original with <strong>components</strong>.</p>
<p>4. How to extend to multiple screen sizes and a design system with <strong>constraints, grids, and styles</strong>.</p>
<p>5. A walk-through of building <strong>one login screen</strong> to tie the flow together.</p>
<h2>A Frame Is a Small Box Inside the Screen</h2>
<p>If an artboard is one finished piece of output, a frame is a small box you put inside it. If you make the units that compose a screen, such as buttons, cards, and a single row of a list, into frames, you can handle the elements inside as one lump. In Opkle Editor, press F and drag inside the artboard to make a new frame, or select elements you've already drawn and press ⌥⌘G to make a frame that wraps them.</p>
<p>When you select a frame, Clip On · Off appears in the inspector. With it on, content that goes outside the frame appears cut off, which is useful for putting a photo inside a card or imitating a scroll area. Beginning to see a screen not as a collection of simple shapes but as a structure of boxes is the first step of UI design.</p>
<p>Frames can be placed inside other frames. The whole screen is a large frame, with a header bar, a list, and a bottom tab bar going in as frames, and card frames going inside the list, and so on. In a structure nested this way, the keys that step in one level with Enter, select the parent one level out with ⇧Enter, and move to the next element with Tab are especially useful. You can move along the structure without hunting with the mouse.</p>
<h2>Auto Layout Places Things by Rules</h2>
<p>Auto layout is a feature where, instead of placing elements by hand, you set rules and elements are laid out according to them. Select a frame and click Auto Layout Settings in the inspector, or press ⇧A, to turn it on. You can check the result in the preview on the left while setting values, so it isn't hard to get a feel for it even at first. You can also drag elements in the preview to change their order.</p>
<p>The rules are simpler than you'd think. Choose whether to line elements up horizontally, stack them vertically, or place them in a grid, and decide whether to wrap when they overflow. Then set the spacing between elements and the padding inside the frame, and choose the alignment for where the elements gather. The alignment can also be chosen by clicking one of the nine zones in the preview directly, so when it's hard to put into words, clicking the spot you want is faster.</p>
<p>Finally, decide whether to fix the frame size or leave it to fit. Leave it to fit and the frame grows along with the elements inside, so you get a button that stretches on its own with the text length. Even if “OK” becomes “Pay and Continue,” the button widens by itself, and if a card gains a line, the card lengthens by itself. Once you've experienced this ease, it's hard to go back to making mockups without auto layout.</p>
<p>For spacing and padding, it's good to settle on a handful of numbers and use only those. For example, if you settle on 4, 8, 16, and 24, the whole screen gets a consistent rhythm, and it's easy for someone else who takes over to follow the same rules. Auto layout is also a device that locks those rules in as numbers.</p>
<h2>Components Tie Repetition to One Original</h2>
<p>Elements used repeatedly in many places, such as buttons, icons, and cards, are best made into components. When you edit the original, all the copies made from it, the instances, follow along, so you no longer have to go through ten screens to change one button color. Select a frame and press ⌥⌘K, or make one from the Component group in the right-click menu.</p>
<p>Not everything has to follow the original. If you want to change just one place separately, select that instance and detach it with ⌥⌘B, and it no longer follows the original. But a detached instance doesn't reconnect, so it's wise to detach only after making sure it really is an element to manage separately. Buttons with different states, such as default, pressed, and disabled, can be grouped as variants and managed in one place.</p>
<p>The components you make gather in the Assets window of the Component Assets section on the right. Because it also shows ones made in other projects, you can use the same parts across projects, and versions are attached according to how many times they've been edited. You can also check whether one is being used in the current file, so even as parts multiply, keeping things organized isn't hard.</p>
<h2>Extending to Multiple Screen Sizes and a Design System</h2>
<p>Apps and websites don't end at one screen size. You have to think about how the same design looks on a phone, a tablet, and a desktop. This is where constraints and layout grids come in.</p>
<p><strong>Staying in place when the screen changes</strong></p>
<ul>
<li>Select an element and click Constraint Settings, and you can set what the element attaches to and follows when the artboard size changes.</li>
<li>If you set the top-right close button to “right and top,” and a top bar that spans the full width to “left and right,” they stay in place even when the screen width changes.</li>
<li>Laying a layout grid on an artboard or frame makes it easier to align to columns and rows, and ⌃G toggles its visibility.</li>
<li>Placing mobile, tablet, and desktop screens side by side as several artboards and matching them to the same grid keeps a responsive mockup neatly organized.</li>
</ul>
<p>As parts and screens multiply, it's time to manage color and text by rules as well. If you make fill styles, paragraph styles, and vector styles, fixing one style changes every place that uses it. With color variables that hold two values, light and dark, you can view the light and dark versions of the same screen side by side without drawing two sets. Components, styles, and color variables together make a small design system.</p>
<h2>Building One Login Screen</h2>
<p>Concepts get into your hands fastest when you actually build something. Take a simple login screen as the example.</p>
<p>First, make a phone-sized artboard and place one frame in it with vertical auto layout turned on. Into this frame, put the logo, the title text, two input fields, the login button, and the note text below, in order. Set the spacing to 16 and the padding to 24, and the elements stack vertically at even intervals. Make one input field a frame, set its padding with auto layout, and turn it into a component, and the second input field is done by placing one more instance.</p>
<p>Make the button a component the same way and leave its width on fit, and it becomes a button that stretches with its text. Now try changing “Log In” to “Continue with Email.” The button stretches, and the note below it is pushed down automatically. Finally, duplicate this artboard, change it to tablet size, and set the outer frame's constraint to “center,” and you have a mockup where the login box stays centered even as the screen gets wider.</p>
<p>After going through this flow once, you realize that frames, auto layout, and components aren't separate features but a single way of thinking: divide the screen into boxes, give the boxes rules, and tie repeated boxes to an original.</p>
<h2>Design Runs Until the Mockup Is Handed Off</h2>
<p>When the mockup is finished, it's good to organize the images to hand to developers too. Save the format and scale for each layer in the export settings and press ⇧⌘E, and icons come out as SVG and images as PNG at 2x, all at once. Whenever the design changes, the same shortcut once does it, so even handoff becomes a rule rather than repetition. The layer name also becomes the file name, so don't forget to name layers clearly.</p>
<p>You don't need to make everything a component or style from the start. Begin with the single button you use most: group it as a frame, turn on auto layout, and convert it to a component. Place that button in a few spots on the screens and change the original's color, and you'll understand at once why the three concepts go together.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>Frames let you see a screen as a structure of boxes like buttons, cards, and lists, and you can move along that structure with Enter, ⇧Enter, and Tab.</li>
<li>Auto layout places things by rules for spacing, padding, and alignment, making parts that stretch on their own with their content.</li>
<li>Components tie repeated parts to one original, so a single edit changes every screen.</li>
<li>Constraints and layout grids keep things consistent across screen sizes, and styles and color variables do so at the design system level.</li>
<li>Building one login screen gets the one way of thinking, “divide into boxes, give rules, tie repetition to an original,” into your hands.</li>
</ul>]]></description>
      <category>design</category>
      <pubDate>Tue, 10 Nov 2026 05:26:00 GMT</pubDate>
    </item>
    <item>
      <title>Vector Graphics 101 — Making a Logo</title>
      <link>https://opkle.app/abstract/blog/design/vector-graphics-basics?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/design/vector-graphics-basics?lang=en</guid>
      <description><![CDATA[<p>When you first open a graphics tool to make a logo, the first word you meet is “vector.” You vaguely know how it differs from a photo and why logos are always supposed to be made as vectors, but standing in front of an empty artboard, you don't know where to start. The pen tool doesn't move the way you expect, and the curves keep coming out crooked.</p>
<p>Yet most complicated-looking logos and icons start from very simple shapes. Combine a circle and a rectangle, subtract the overlap, round the corners, tidy a few points, and a convincing shape appears. Drawing from scratch with the pen is needed less than you'd think. Vector graphics is less a skill of drawing than a skill of assembling.</p>
<p>In this article, we start from what vector graphics is and follow the flow of making one logo with shapes, the pen, and pathfinder.</p>
<p>1. Learn how <strong>vectors and pixels</strong> differ, and why logos are made as vectors.</p>
<p>2. See how to block in basic forms quickly with the <strong>shape tools</strong>.</p>
<p>3. See how to combine and subtract shapes into new forms with <strong>pathfinder</strong>.</p>
<p>4. See how to refine curves with the <strong>pen and point editing</strong>.</p>
<p>5. See how to finish the logo with <strong>color, stroke, and export</strong>.</p>
<h2>A Vector Stores a Shape as a “Description”</h2>
<p>A pixel image such as a photo is a mosaic of tiny dots of color. It remembers the picture with a fixed number of dots, so when enlarged, the dots show up and it looks blurry or stair-stepped. A vector graphic, on the other hand, remembers a shape as the positions of points, the lines that connect them, and the color that fills the inside. It's like storing a description: “start here, follow a line that curves like this, and end over there.” So whether it's used at business-card size or on a banner as big as a building's outer wall, it's redrawn and stays just as sharp.</p>
<p>That's why logos are made as vectors. A logo is used in places of wildly different sizes, such as app icons, website headers, business cards, signs, and merchandise. If you make it a vector from the start, one original is enough wherever it goes. Changing colors or fixing part of the shape is easy too, because the points and lines remain alive.</p>
<p>Of course, vectors aren't right for every picture. Pictures with subtle color gradations, like photos, are expressed better by pixels. So a good graphics tool has to let you move between the two. In Opkle Editor, you can harden a vector shape into a pixel picture with right-click Convert › Rasterize, and conversely turn a photo into shapes with vector tracing. Think of it as dividing the work: the logo as vectors, and the photo the logo sits on as pixels.</p>
<h2>Build the Frame With Shapes First</h2>
<p>Most logo work begins with shape tools. Click the Shapes section in Opkle Editor and ten forms unfold, including rectangle (R) and ellipse (O), plus triangle, polygon, star, badge, arc, and donut. Choose one and drag over the artboard to draw it; hold ⇧ while dragging to lock the proportions, giving a square or a perfect circle, and hold ⌥ to draw from the first click as the center. Options that differ by shape, such as a polygon's number of points, a star's depth, or a donut's inner size, can be changed by right-clicking the canvas with the tool selected.</p>
<p>At this stage, rather than trying to draw the finished form, it's better to break the logo's big masses into shapes. For example, a speech-bubble logo can be split into one rounded rectangle and one small triangle, and a key-shaped logo into one circle and a few long rectangles. If you want rounded corners, use the corner radius tool to pick and drag only the corners you want, and with corner smoothing, the rounded corners blend more smoothly into the straight lines, giving the sleek shape of an app icon.</p>
<p>It's also good to set exact balance at this stage. Select several shapes and use the alignment group to center them or distribute the spacing evenly, and type X, Y, W, and H as numbers in the transform section on the right to match sizes. In a logo, even a small misalignment stands out, so the habit of matching by numbers rather than by eye keeps the result neat.</p>
<h2>Combine, Subtract, and Keep Only the Overlap With Pathfinder</h2>
<p>Once you've built the frame with shapes, it's time to weave them into one form. Select two or more shapes and use the pathfinder group in the toolbar to make a new shape. Unite merges the selected shapes into one, subtract carves the lower shapes out in the shape of the top one, and intersect keeps only the overlapping part. Overlap two circles slightly offset and subtract to get a crescent, and unite a rounded rectangle and a triangle to get a speech bubble.</p>
<p>Subtract uses the shape placed on top as its reference, so if the result isn't what you expected, check the layer order first. When you need a single shape with a hole in it, like a donut, use a compound path; find “Make Compound Path” in Quick Actions (⌘/).</p>
<p>If you want to wrap one more border around the logo, try offset. It creates a new path outward or inward by a fixed distance, so exactly the same spacing holds everywhere. A job that's easy to get subtly wrong by hand finishes cleanly with one number. For a logo where the same shape repeats around the edge, like petals or gear teeth, use the radial option of Repeat. Make just one piece, set the count and spacing, and it arranges the pieces around a circle for you.</p>
<h2>Add Curves With the Pen and Refine Points One by One</h2>
<p>Curves that you can't make from shapes alone are drawn with the pen. Press P to choose the Path tool and click the artboard to place a point; click and drag to make a curve. Click the first point again to close the shape, or press Enter if you want to end with an open line. Pressing ⌘Z while drawing cancels just the last point, so it's easier on the mind to draw by adjusting as you go rather than trying to be perfect from the start.</p>
<p>The trick to using the pen well is placing few points. The more points, the lumpier the curve and the harder it is to fix. Put points only where the curve bends, and practice refining the bend by dragging the handles extending from the points. You can move the points of a path you've already drawn by pressing Enter or picking them one at a time with the node selection tool, and add or remove points with Add Point · Remove Point. Jagged parts even out when you rub them with the Smooth tool.</p>
<p>One thing to know: shapes such as rectangles and stars are “live shapes” with options like number of points, so you can't edit their points directly. Choose right-click Convert › Convert to Path and it becomes a path you can edit freely, but after that you can no longer use the shape options, so it's wise to duplicate the original before converting if you need it.</p>
<p>Hand drawings and text can be logo material too. A sketch or handwriting on paper can be brought into the canvas as a photo and turned into shapes with vector tracing, and if the result is complicated, simplify to tidy the number of points. For a logo made of letters, right-click Outline to turn the text into shapes, then combine it with other shapes using pathfinder. After converting to outlines you can't edit it as text, so it's good to get in the habit of duplicating the original text.</p>
<h2>Set Color and Stroke, and Export for Where It's Used</h2>
<p>When the shape is done, apply color. In the Fill section on the right you can pick a solid color or switch to a gradient, and you can stack several fills to add expression. But logos often have to be printed small and in a single color, so it's safer to finish in solid color first and make a separate gradient version when needed. For a logo that uses strokes, convert the strokes to fills with right-click Convert › Expand Stroke. That way the stroke thickness keeps its proportion even when you resize.</p>
<p>Export the finished logo in a format that fits where it will be used. For a logo going on a website or app, exporting as SVG keeps it sharp on any screen, and if you need a PNG with a transparent background, export at 2x or 3x scale. For print, exporting as PDF is the safer choice. If you set the format and scale for each layer in advance, you don't have to export one by one every time you edit the logo; a single ⇧⌘E exports everything you've set up.</p>
<p>Your first logo doesn't have to be perfect. After going through the order of building a frame with shapes, weaving it with pathfinder, and refining with the pen a few times, you'll start to see, even in other people's logos, which shapes were overlapped to make them. From then on, vector graphics becomes less drawing and more engineering.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>Vector graphics store shapes as descriptions of points and lines, so they stay sharp at any size, while photos are best handled as pixels.</li>
<li>Rather than drawing a logo from scratch with the pen, it's easier to block in the big masses with shapes, balance them by numbers, and weave them with pathfinder.</li>
<li>Offset and radial repeat let you make borders and repeating patterns that are hard to match by hand.</li>
<li>With the pen, put points only where the curve bends and refine curves with the handles; hand drawings become material through vector tracing, and text through outlines.</li>
<li>Finish the logo in solid color first, and export it in a format that fits where it's used, such as SVG, PNG, or PDF.</li>
</ul>]]></description>
      <category>design</category>
      <pubDate>Tue, 10 Nov 2026 05:26:00 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: How the EPUB Editor Ties It Together</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-21?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-21?lang=en</guid>
      <description><![CDATA[<p>After building the Publisher, I looked again at where the EPUB editor sits. Vector graphics, multi-page layout, data-driven tables and web publishing documents were each working fine as independent editors. But what users make isn't four separate kinds of projects; it's a single book that holds images, tables, typesetting and published results together.</p>
<p>Making them openable from the EPUB editor's menu wasn't enough. It all had to connect in one flow: which book a piece of work started from, which element of the body the graphic being edited is linked to, where the result made in the layout should be sent back, and which workspace to return to after closing a publishing document. What was needed was designing the relationships between editors rather than the features of each editor.</p>
<p>So I didn't turn the EPUB editor into a huge program that performs every function itself. The specialized editors keep owning their own documents and render engines, while the EPUB editor passes along the context of the current book, opens the appropriate workspace, waits until the result is committed, and then integrates it back into the book. From that point, the EPUB editor went beyond being a body-text editor and became an orchestration layer that manages the whole production process.</p>
<h2>Editor orchestration</h2>
<p>The criterion for orchestration was simple. The central editor must not own every detailed feature, and the specialized editors must not know each other's internal structure. The center decides which job to hand to whom, passes along the context needed to start, and remembers where to receive the result when the job is done. A specialized editor edits only the documents it handles best and returns the agreed-upon result. This is a division of authority as well as a restriction on the direction of dependencies.</p>
<p>The vector editor becomes the authority on shape space and change over time. The layout editor manages page geometry and text flow. The table editor owns the cell structure and calculations, the multiple views and the render regions. The Publisher manages the reading order, screen layout, public state and the identity of the web document. Since the EPUB editor doesn't hold a duplicate of this state, each engine can evolve independently. There must be exactly one authoritative source.</p>
<p>Conversely, what a result means inside the book is decided by the EPUB editor. A graphic becomes a particular visual component of the body, and a table becomes a publishing visual linked to an editable source. A layout result goes into the book as a chapter or as fixed-layout content, and the Publisher finalizes the current book or graphic document as the web version readers read. This splits the authority of the working engines from the authority over the book's composition.</p>
<p>This separation mattered more than splitting features. Even if one editor's storage format changes, the others don't need to interpret its internals. The central editor only has to maintain the meaning and origin of the result, and when it must be edited again, send it back to the source workspace. Different document models don't get blended into one huge shared state, yet the user can work as if in a single program. It is a design that keeps relationships without merging state spaces.</p>
<h2>One Project, Many Workspaces</h2>
<p>Each specialized editor creates an independent project, but that project always belongs under the current book. Even if vector documents with the same title exist in several books, they don't get mixed up, and a single book can hold a cover graphic, body illustrations, a main layout, several tables and a publishing document at the same time. The EPUB project the user is looking at becomes the center of this work graph. The book is the root, and the specialized documents are child nodes beneath it.</p>
<p>When a new job starts, I pass along the current book's membership, the kind of document to create, a default title and, when needed, the relationship to the body element being edited. When an existing job is reopened, the source document belonging to the same book is found precisely and restored. Because I separated the entry for new documents from the entry for existing ones, I could prevent cases where making a new table shows the last table I had opened, or where a new publishing document overwrites a previously public one. Creation and restoration are different morphisms.</p>
<p>I also made the parent book's fonts and shared assets available inside the specialized editors. Without registering the same typeface again in each editor, vector text, layout body text, table images and the EPUB body keep the same typography. Each editor manages assets in the way it needs, but they never reach beyond the book's scope to pull in another project's files. Sharing is allowed; references across the boundary are forbidden.</p>
<p>The EPUB editor's source screen uses this relationship to show graphics, layouts, tables and publishing documents separately. When you close a specialized document and come back, the list is re-read and the result you just made shows up immediately. Users don't go find the output in a file explorer and import it again; they pick a working source linked inside the book and continue editing right away.</p>
<h2>Context routing</h2>
<p>Which editor to open means more than switching screens. Depending on whether the currently selected element is an ordinary image, an editable vector component or a result linked to a table source, the same activation has to lead to a different workspace. The EPUB editor reads the origin and link state left on the body element and picks the appropriate source editor. A selection event is mapped to different paths depending on type.</p>
<p>When creating a new graphic, the image selected in the body and its display area can serve as the initial context for the job. When opening an existing graphic, the already linked source is restored, and the position and size placed in the current EPUB remain as book-side state. Fixing the inside of a graphic doesn't reset the paragraph flow or outer placement decided in the body. Internal state and placement state are different layers.</p>
<p>Layout and tables follow the same principle. A layout can absorb the current book's content and typeset it into pages, or start as a completely new fixed-layout document. A table either creates a new data document or reopens an existing source linked to a body image. Since the purpose of the job is fixed at entry, there was no need to guess which document to use inside the specialized editor.</p>
<p>The shared AI tool follows this context as well. When editing the EPUB body, it understands the selected structure and style context, and when a vector workspace is open, it passes commands based on the current object and canvas state. In a table it uses the selected cell and active view, and in a layout the context of pages and text flow. A single input box determines the active workspace and connects to each editor's command system. This routing keeps context from leaking into the wrong command space.</p>
<h2>Switching Workspaces</h2>
<p>I didn't use a method that stacks specialized editors on top of each other at the same time. Only one workspace is active at any moment, and when a switch is needed, the current editor's state is committed first before the next editor opens. That way there is no ambiguity about which editor the focus, selection state, popup layers, autosave and AI context refer to. It is mutual exclusion that limits the size of the active set to one.</p>
<p>A typical case is wanting to redraw an image from the layout as a vector. The user isn't aware of closing the layout and creating a separate file. The system remembers the relationship between the current page and the original image, switches to the vector workspace, and when editing ends, commits the result and reopens the same layout document. The new result keeps the existing frame's position and updates only the content and its ratio. The relationship is kept and only the payload changes.</p>
<p>The flow of making a table from an empty layout frame is the same. The table editor creates a source document with data and views, completes the publishing render, and then returns to the layout. An image result is placed in the layout, but the link to the table project behind it remains. If you later reopen the table and fix a cell, only the result in the same frame is replaced.</p>
<p>When moving from vector or layout to web publishing, I remembered the finished graphic package together with the location of the source workspace. After adjusting the design and reading order in the Publisher and closing it, you return to the vector or layout document you were working on. Since the central EPUB editor manages the movement paths between editors, the child editors don't need to know each other's screen structure. The paths live only in the central graph.</p>
<h2>Source of truth</h2>
<p>What I was most wary of when connecting the editors was having the same state managed authoritatively in several places at once. Just because a vector graphic has been put into an EPUB doesn't mean the EPUB side duplicates and edits the whole layer data. The book keeps the rendered component and the link to the source, and detailed edits are always performed by going back to the vector source. It's a reference, not a copy.</p>
<p>The same goes for tables. The EPUB contains the table image readers will see, but the source of rows and columns, calculations and views is managed by the table editor. A layout document provides per-page results and how they're used within the book, but the authority over masters and text flow stays with the layout editor. The Publisher likewise manages settings for the public screen and doesn't replace the authoring source of the EPUB body. Each node has exactly one source of truth.</p>
<p>Thanks to this principle, synchronization stopped being a problem of replicating all state in real time. Each editor commits its own source, and the center atomically replaces only the result and the link relationship. Half-finished states in the middle of an edit and unsaved intermediate values never come into the book, and the last completed result always has a source from which it can be regenerated. Only committed results cross the boundary.</p>
<p>When a source is updated, the link identifier is kept as well. Even if a graphic is re-rendered or a table image is replaced, the body element's position, responsive conditions and the surrounding document flow remain as they were. When a publishing document is rebuilt, only the content is updated while the document with its existing design settings and public address is kept. I separated the lifecycles of source and result while making sure the relationship between them never breaks.</p>
<h2>Returning Results to the Book</h2>
<p>I didn't flatten the results of every specialized editor into the same file format. Vector work can return as a graphic component that preserves structure and motion, and when a final image is needed, it comes in as a raster result with its resolution and background fixed. A table becomes an image that displays reliably in the EPUB while keeping the data editable. The result type differs by purpose.</p>
<p>Layout results differ depending on the page structure. When absorbed into the EPUB body, the document's structure and styles, images and fonts are tidied into a self-contained state and handed over, and when a fixed-layout result is needed, it is used as a graphic document that preserves the page geometry. Depending on which result arrives, the central editor registers the book's assets, tidies the paths and inserts it in a form that fits the body structure. These are per-type insertion rules.</p>
<p>In this process I preserved not just the visual look of the result but also its origin and re-editability. A graphic placed in the body keeps a record of which source project it came from, and a table image keeps its relationship to the source data document. When a result is deleted or duplicated, the lifecycle of the linked source and assets can be judged along with it.</p>
<p>When insertion is complete, I update the EPUB editor's various previews and document state so they all read the same result. After changing a single graphic, no per-device preview holds a different stale image, and the document representation being saved and the actual screen use the same asset path. At the last point where a specialized editor's result enters the book, EPUB's consistency rules are applied again. Every observable surface must converge on the same state.</p>
<h2>Commit boundary</h2>
<p>I treated the moment of closing a workspace not as a UI event but as a transaction boundary. If the user is in the middle of typing into a cell or a title, the focus is cleaned up to commit the last value, and the system waits until all scheduled edits and autosaves have finished. For things like graphics or tables that need a render result to send back to the book, closing doesn't finish until that result is generated. Only committed state goes out across the boundary.</p>
<p>Even when a save is in progress, I didn't start a second save in parallel. Saves are serialized so that the latest changes are committed once more after the current save ends, and the workspace is removed only after the specialized editor reports it is done. This prevents cases where the screen closes first and cuts an asynchronous job short, or where the last typed character or the last object move is lost. Termination is a post-condition of completion.</p>
<p>The EPUB editor that receives the result doesn't just swap the screen right away either. It checks that all the necessary assets are registered, decides whether to replace the existing element or create a new one, and updates the various previews and saved documents together. Then it re-reads the work list to reflect the source project's latest title and modification time. Closing and returning behave as one committed state transition.</p>
<p>When a response is delayed or result generation fails, I put the current book's healthy state first. If the new result isn't complete, the existing element isn't deleted, and information about the interrupted transition is cleaned up so it isn't reused by the next job. Only successful jobs are reflected in the book, and failed ones keep the previous complete state. It is fail-closed behavior plus preservation of the previous complete state.</p>
<h2>The Center of Shared Services</h2>
<p>Just because the specialized editors are independent doesn't mean each has to rebuild every foundational feature. The current user and the book's membership, shared fonts, project assets, the AI entry point and returning to a workspace are all provided from the center by the EPUB editor. Child editors take only the services they need and focus on editing features. The shared layer is policy, and the specialized layer is computation.</p>
<p>In particular, the AI entry point stays central while execution is left to each editor's verified command layer. The parent checks which workspace is currently active and what is selected, and builds the context of the request. I structurally blocked cases where a command that handles vector objects enters the EPUB body editing path, or where a table cell command is applied to a layout page. A command's domain and range are bound to a workspace.</p>
<p>Fonts are also shared around the book's asset context. A typeface registered in the EPUB can be used with the same family and weight in graphics, layouts and tables, and when a specialized document adds its own font, the assets needed are bundled together when the result is sent to the book. This reduced the problem of text looking the same on the editing screen but switching to a fallback in the final output.</p>
<p>What I centralized this way isn't feature implementation but context and policy. The actual shape editing, typesetting, cell calculation and publishing render stay in their own engines. The shared layer provides the continuity of knowing you're editing the same book wherever you are, while the specialized layer keeps the depth of each field.</p>
<h2>Portable workspace</h2>
<p>If specialized documents are linked to a book, then when moving the EPUB project to another computer, those sources have to move along with it. If only the finished EPUB body is exported, the table images still show but the cell data is gone, and vector graphics still show but their structure can't be edited again. The web publishing settings and the layout source run into the same problem. It's like keeping the result while losing the function that generated it.</p>
<p>So when making a project into a package for storage, I collected not only the EPUB's body and assets but also the vector, layout, table and Publisher documents belonging to the book. Each editor's document structure is preserved as it is, and images, fonts, structured source data and graphic packages are bundled separately according to their roles. I made sure the central package doesn't crush all the documents into one huge shared document. It serializes the graph while keeping each node's type.</p>
<p>When imported in another environment, existing identifiers aren't trusted as they are; they are reassigned as identifiers of the new storage. The images and fonts a document referenced, its pages and layers, asset references in table cells and the source-package link of a publishing document are all replaced with the new identifiers. If several documents share one asset, it is restored only once and they all point to the same new target. It's a relabeling that preserves the equivalence relation.</p>
<p>Even if some documents fail during restoration, cleanup is done per document so that already created incomplete assets don't linger as orphans. Conversely, files missing from the asset list but actually referenced by a document's content are scanned from the content and restored as well. Export and import became a process of rebuilding the referential integrity of the entire work graph, not a simple file copy.</p>
<h2>A Structure That Converges on One Book</h2>
<p>With this structure complete, the role of the EPUB editor became clear. It isn't an all-purpose canvas that draws or typesets everything itself, but a central production environment that calls specialized editors based on the book's body and assets and converges the results back into a readable document. The editors are separate, but the project's flow is never interrupted.</p>
<p>I repeatedly reviewed new and existing graphics, new tables and linked tables, layouts that absorbed an EPUB and empty layouts, round trips from layout to vector and table, and the flow of moving from vector or layout to the Publisher and returning to the source. I confirmed that the last committed state is preserved even when closing during an autosave, when result generation fails, and during rapid workspace switching and reopening of existing documents.</p>
<p>I also checked exporting the whole project and restoring it on another device, down to vector structure, layout pages and masters, the table's source data and views, and publishing settings and source packages. The newly assigned asset relationships and the source links remaining in the body all matched, and the round trip of re-editing a restored specialized document and updating the EPUB result passed without problems.</p>
<p>The orchestration that connects the EPUB body, graphics, typesetting, data visualization and web publishing into a single project flow was fully implemented and stabilized. Opkle's EPUB editor is now not a tool for making one file but a production system that connects all the specialized work through which a book gets finished.</p>]]></description>
      <category>dev</category>
      <pubDate>Sun, 19 Jul 2026 01:38:36 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: Making Fixed Pages Flow Again</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-22?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-22?lang=en</guid>
      <description><![CDATA[<p>After completing the orchestration structure, I had to reconnect work finished in the layout editor to EPUB editing. The layout editor is a tool for placing text, images and shapes at exact coordinates within a paper-like trim size. The body the EPUB editor handles, on the other hand, keeps reflowing according to the reader's screen and font size. They are two editors making the same book, but the way they interpret space is nearly opposite.</p>
<p>Turning a fixed page into an image and dropping it in wasn't a solution. The look survives, but paragraphs, headings, reading order, responsive columns and media queries disappear. Conversely, if I throw away all the coordinates and string the text together, the hierarchy and spacing set up in the typesetting, the side-by-side structure and the visual rhythm are lost. What I needed wasn't to copy the appearance of a fixed layout but to re-estimate the hidden document structure that produced that appearance.</p>
<p>I defined the process of turning layout results into reflowable HTML and CSS as a single inverse problem. What is observed on a page is the final coordinates, but what EPUB needs is the semantic structure behind those coordinates. The converted result had to be something I could edit again in the EPUB editor, fixing paragraphs, changing styles and extending media queries. The task was to treat the fixed result not as an endpoint but to turn it back into the starting point of an editable flow.</p>
<h2>Inverse layout</h2>
<p>Ordinary typesetting can be seen as a forward function \(L(S,E)=G\) that takes a semantic structure \(S\) and an environment \(E\) and produces a geometric result \(G\). Given the order and styles of paragraphs and the column structure, the typesetting engine breaks lines, builds pages and decides each element's coordinates. Going from fixed layout to reflow is the opposite: finding a possible \(S\) from an observed \(G\).</p>
<p>But \(L\) generally has no inverse. Different HTML structures and CSS can produce the same screen, and whether an element belongs to the document flow or merely overlaps as decoration isn't uniquely determined by coordinates alone. In other words, there are plenty of cases where \(L(S_1,E)=L(S_2,E)\) while \(S_1\neq S_2\). Restoring the original structure exactly from a single fixed screen is inherently ill-posed.</p>
<p>So instead of trying to guess one solution, I set up an objective function. Putting together an error \(d(L(S,E_0),G)\), which says how well a candidate structure \(S\) reproduces the original geometry, and a structural complexity \(\Omega(S)\), the restoration becomes \(S^*=\arg\min_S\{d(L(S,E_0),G)+\lambda\Omega(S)\}\). It is a regularization that prefers a structure that's a little simpler but flows stably across many screens over a complicated absolute placement that merely resembles the original.</p>
<p>Here \(\lambda\) is the balance between fidelity and generalization. If it is too small, the result is a coordinate replica that fits only one trim size, and if it is too large, all visual hierarchy flattens out. The actual conversion doesn't lean on one particular number; it strikes this balance by treating preservation of meaning and responsive stability as invariants. Only after acknowledging that the inverse solution isn't unique could I consistently choose a solution suited to EPUB.</p>
<h2>Recovering Order</h2>
<p>Elements of a fixed layout sit on a 2D plane, but an EPUB body basically has a 1D order. Being higher on the page, being further left and being inside the same box are different relationships. If I simply sort by \(y\) and then by \(x\), the reading order breaks down easily as soon as there are multi-column layouts, captions, background boxes and overlapping elements.</p>
<p>If the element set is \(V\), I can first think of a directed graph \(D=(V,A)\) that has only the unambiguous precedence relations as edges. I put \(u\to v\) only where \(u\prec v\) is clear, and elements whose order can't be decided right away, such as those on the same row or in a containment relation, stay as a partial order until more context becomes available. The reading order becomes one of the several linear extensions this DAG allows.</p>
<p>A good linear extension doesn't merely minimize geometric travel. The semantic cost must also be small: body text following a heading, an image staying close to its caption, and content of one column not jumping into another. Viewing this as a cost function \(C(\pi)=\alpha C_{geo}+\beta C_{semantic}+\gamma C_{discontinuity}\), order recovery becomes the problem of finding, among possible permutations \(\pi\), one with a small total cost.</p>
<p>When the original DOM or editing history survives, it can be used as a strong prior, and when only geometric information remains, alignment and containment relations carry more weight. What matters is not pushing every document through the same single coordinate sort. I built the partial order from both the explicit meaning and the observed geometry, and made it converge on a linear flow without contradictions.</p>
<h2>Interval geometry</h2>
<p>Projecting each element of a page onto the \(x\) and \(y\) axes gives two intervals, \(I_x=[x_0,x_1]\) and \(I_y=[y_0,y_1]\). Whether two elements share a row, share a column, or one encloses the other is more stably described by the relationships between these intervals than by a single point coordinate. Letters and images of different sizes can be compared in the same language through intersections and containment of intervals.</p>
<p>The degree of overlap between intervals can be seen by normalizing \(\mu(I_a\cap I_b)\) by the union or by the length of the smaller interval. What matters, though, is not a particular threshold but that the normalized relationship doesn't change under enlargement or reduction. Even when the same trim size is observed at a different magnification, the relative overlap and order of intervals are preserved. Using relationships instead of coordinate magnitudes keeps the conversion from depending on the screen scale.</p>
<p>Elements whose vertical intervals overlap strongly may form one horizontal structure, and elements whose horizontal intervals are similarly aligned may be the flow of one column. Expressing this as an interval graph, the vertices are elements, and an edge appears between elements that intersect along a given axis. Connected components, cliques and containment trees are different viewpoints describing row candidates, overlap groups and container candidates respectively.</p>
<p>I didn't settle meaning with the interval graph alone. An element that spans widely, like a decorative rule, intersects with almost everything, and a large background can turn the whole page into one connected component. So I used the interval relations not as the answer that decides structure but as geometric evidence for narrowing the candidate space. Thanks to this distinction, even complicated pages weren't merged into one excessively large group.</p>
<h2>Dimensionless Coordinates</h2>
<p>Coordinates in a fixed layout are tied to a specific page width and height. A value like \(x=120\) loses its meaning the moment the page changes, whereas \(x/W\) keeps describing where in the full width the element sits. In the reflow conversion, I had to preserve ratios of lengths rather than the lengths themselves. The moment coordinates become dimensionless numbers, the proportional relationships of the structure can be separated from the size of the trim.</p>
<p>From the viewpoint of the Buckingham \(\Pi\) theorem, variables that carry dimensions, such as width, height, font size and spacing, can be organized into independent dimensionless combinations. Element width \(w\) can be seen as \(w/W\), vertical gap \(g\) as \(g/f\) relative to the body font size \(f\), and border thickness \(b\) as \(b/\min(w,h)\) relative to the element size. Which quantity you divide by becomes the meaning of the choice of CSS unit.</p>
<p>Horizontal widths and column positions should respond to the container width, so ratio coordinates are natural for them, while paragraph spacing and inner padding should respond together to font enlargement, so typography-based coordinates are natural for those. Rather than converting every value into one relative unit, I chose a different reference depending on which scale group each value has to covary with.</p>
<p>The resulting transformation has to have scale equivariance. Even if the input trim size is enlarged \(k\) times, the dimensionless structure stays the same, and when the result is placed on another screen, it gets its dimensions back from that screen's reference quantities. I aimed for a structural representation close to \(T(kG)=T(G)\) and a render relation close to \(R(T(G),kE)=kR(T(G),E)\). I didn't erase the fixed coordinates; I preserved the proportional laws the coordinates were carrying.</p>
<h2>Typography metric</h2>
<p>The outer rectangle of a text box and the boundary of the letters the reader actually sees are different. Letters are placed relative to the baseline, with an ascender above and a descender below, and line-height includes leading outside the glyphs. This is why text placed at the geometric center of a box can still look visually sunk toward the bottom.</p>
<p>If the body font size is \(f\), the line spacing is \(\ell\) and the baseline position is \(b\), the visual center of a line is not simply \(\ell/2\). A correction term \(\alpha f\) reflecting the font's x-height, cap-height and ascender ratios is needed, and a rough model can be written like \(c_{opt}=b-\alpha f\). \(\alpha\) is an optical coefficient that describes how ornaments and letters align, not an arbitrary pixel adjustment.</p>
<p>The spacing between paragraphs can't be computed from just the difference between the end of one text box and the start of the next either. When there is unused space inside a box, or the last paragraph is only partly visible, using the outer boundary makes the reflow result show larger gaps than the real ones or sentences that were never visible. What's needed is the boundary of the line boxes and of the visual support actually occupied by the content.</p>
<p>Empty paragraphs likewise don't all mean the same thing just because the string length is zero. An intentional blank line, an empty node left over from editing, and content pushed out of its box and not visible are all different. Only by looking at the topology and the metrics of the typography together can I tell which whitespace to keep and which to remove. The rhythm of headings, body text and captions held up after conversion because I used the geometry of the text lines, rather than the boxes, as the reference.</p>
<h2>Overlap topology</h2>
<p>In fixed layouts, it's natural for elements to overlap. A heading can sit on a background color box, a thin line can pass through the middle of text, and a caption can sit over an image. In reflow, I can neither carry every overlap over as absolute positioning nor unroll every element vertically. First I have to classify what the overlap means.</p>
<p>If the region an element occupies is seen as a subset of the plane \(A_i\subset\mathbb{R}^2\), then containment \(A_i\subset A_j\), intersection \(A_i\cap A_j\neq\varnothing\) and disjointness \(A_i\cap A_j=\varnothing\) are different topological relations. If a large region contains smaller regions and sits visually behind them, it may be a container, and if a thin region only partly intersects the text, it may be decoration. The relation can be the same while the role differs, so z-order and semantic type are both needed.</p>
<p>If every connected component of the overlap graph is turned into one absolute-positioned group, the responsive properties are lost. If every edge is removed, the original's compositional relationships collapse. So some edges have to be contracted into set containment, some left as decorative relationships independent of the flow, and the rest unrolled into ordering relations. It's a process of relabeling the edges of the graph as a different kind of relation, not of deleting them.</p>
<p>Thinking of this conversion as topology preservation makes it clear what must be kept even when the screen size changes. The exact intersection area may vary, but the relationship that a background contains its content, that a caption is adjacent to an image and that a decoration moves along with a particular heading must hold. By putting preservation of relationships ahead of preservation of coordinate values, I kept the original's visual grammar from collapsing in reflow.</p>
<h2>Responsive state space</h2>
<p>The environment of a reflowable document can't be expressed by screen width alone. Gathering width \(w\), height \(h\), orientation \(o\), color preference \(c\), resolution \(\rho\) and the user-set text scale \(s\), the environment becomes a multidimensional state \(e=(w,h,o,c,\rho,s)\). The render result is a function \(R(e)\) defined on this environment space.</p>
<p>Mobile, tablet and desktop are less device names than subsets that partition the environment space. \(E=E_1\cup E_2\cup E_3\), and within each region the same layout constraints are active. What matters is not the number of the split points themselves but the point at which the existing constraint system can no longer satisfy readability and structure at the same time. A breakpoint is closer to a threshold where the active constraints change than to a design convention.</p>
<p>For example, if the minimum readable width of several columns is \(m_i\) and the gap between columns is \(g_j\), the condition for a horizontal arrangement to be possible can be written as \(w\geq\sum_i m_i+\sum_j g_j\). The moment the condition fails, a new topological state is needed, one that reduces the columns or switches to a vertical flow. The problem of continuously shrinking sizes and the problem of changing the structure itself have to be kept apart.</p>
<p>Within each region, sizes and gaps change continuously, while at region boundaries the relationships of rows and columns change discretely. So a responsive layout isn't one smooth function but a piecewise function that is smooth within each piece. I designed the state transitions so that reading order and semantic adjacency are preserved on both sides of a boundary, which let me extend a single screen of a fixed layout into a function valid across many environments.</p>
<h2>Media query algebra</h2>
<p>Before being CSS syntax, a media query is a predicate over the set of environments. Each query \(q_i:E\to\{0,1\}\) decides in which environments a rule is active, with conjunction corresponding to intersection, disjunction to union and negation to complement. The structure that several queries form is a Boolean algebra over the environment space.</p>
<p>A stable responsive document needs its query regions to cover the entire target space, with no unintended gaps. Along with completeness, \(\bigcup_i E_i=E\), it must be decided which rule takes priority in the overlapping regions \(E_i\cap E_j\). If queries are mutually exclusive, interpretation is simple, but orthogonal axes, like color mode and screen width, have to be deliberately crossed.</p>
<p>Handling width intervals \(W_i\) and color states \(C_j\) together, the environment divides into the product set \(W_i\times C_j\). Mobile light, mobile dark, wide-screen light and dark aren't separate files but cells of the same state function. If rules common along one axis are grouped under a higher-level term and only the differences needed in the crossing cells are left, the number of rules shrinks while every combination can still be expressed.</p>
<p>Media query conversion wasn't about inventing arbitrary rules from a single observed trim size. It was about decomposing which relationships are invariant in every environment, which change only in certain width ranges, and which properties depend only on the color axis. Once the domain of the environment predicates was clear, I could detect conflicting rules and unreachable conditions, and produce predictable responsive results across many readers.</p>
<h2>Constraint-preserving CSS</h2>
<p>When moving the columns of a fixed layout into CSS flow, what matters is the overall constraint more than the individual widths. If \(n\) columns make up a row, the ratios \(p_i\) lie on the simplex with \(p_i\geq0\) and \(\sum_{i=1}^{n}p_i=1\). If there are gaps and margins, I have to first set aside the share they take up, and then normalize the column ratios over the remaining area.</p>
<p>Not every column must have a fixed ratio, though. Content that shouldn't shrink, like heading text, has its own min-content constraint, and elements that fill leftover space, like a decorative rule, become elastic free variables. The layout then becomes a linear constraint system that satisfies \(\sum_i w_i+g=W\) while respecting the lower and upper bounds of each \(w_i\). Rather than copying fixed values, I have to recover which variables are fixed and which absorb the slack.</p>
<p>The CSS cascade is also an order structure. When several declarations reach the same property, the winner is decided by the lexicographic order of origin, importance, specificity and source order. In media query conversion, what mattered more than creating many rules was arranging common rules and per-environment rules so they don't conflict within this order. Even if two constraints are active on the same screen at once, the result must not hinge on the accident of authoring order.</p>
<p>The converted CSS became a description of a constraint system rather than a record listing the original numbers. On a wide screen the columns share a row, when the width runs short it moves to a different arrangement state while keeping the semantic order, and when the font size changes the margins follow the typographic ratios. In effect I turned the coordinates of one trim size into equations that can be solved again in many environments.</p>
<h2>Visual fidelity</h2>
<p>Not every visual element can be converted the same way. Text is better kept as semantic structure for search, accessibility and re-editability, and simple geometric shapes can be expressed with the constraints CSS has. Complex curves and compositing effects, on the other hand, may drift further from the original the harder I try to infer a semantic structure for them. Choosing the conversion method was itself an optimization problem.</p>
<p>The cost of a candidate representation \(r\) can be written as \(J(r)=\alpha D_{visual}(r)+\beta D_{semantic}(r)+\gamma C(r)\). \(D_{visual}\) is the visual distortion from the original, \(D_{semantic}\) is the cost of losing textuality and structure, and \(C\) is the complexity of running it in many readers. Minimizing only one term pushes toward extremes, such as a screenshot or an overly complicated DOM.</p>
<p>It lowers the total cost to prefer semantic representation for content that contributes to reflow, and to keep complex visual elements with no structural benefit as stable visual representations. What matters isn't publishing the internal criteria for this division but that, after conversion, both the shapes the reader should see and the meaning the editor should work with are each preserved. Even if the means of expression differ, the role in the document has to be maintained.</p>
<p>Values that directly affect the visual result, such as opacity, aspect ratio, rotation and clipping, were also examined within the same distortion function. When small errors accumulate, it's no longer a difference in one element but a difference in the rhythm of the whole page. I didn't take visual fidelity lightly in the name of preserving semantic structure, and I didn't turn everything into a flat image in the name of protecting visual fidelity either.</p>
<h2>Reflow document</h2>
<p>The result of the conversion isn't a finished screen but a reflowable document in which the HTML structure, the CSS constraints and the necessary resources are closed. HTML expresses reading order and containment, and CSS expresses the geometric constraints that get solved depending on the environment. The resources form the reachability closure referenced by these two structures. With all three together, the same document meaning can be reconstructed in another environment.</p>
<p>Once this document returns to the EPUB editor, it had to have the same editability as ordinary body text. Paragraphs can be fixed again, heading and body styles can be changed, and the column structure and media queries can be extended within the rules of the whole EPUB. I didn't insert the layout editor's result as a closed output; I made it an intermediate representation that the next editing stage can read.</p>
<p>In compiler terms, it's like placing a common IR between the layout document and the EPUB body. It doesn't expose the original editor's internal representation as is, and passes along only the meaning and constraints the downstream editor needs. If this boundary is stable, the semantic contract of the converted document holds even when the internal structures of the two editors change.</p>
<p>I also verified against the same semantic state, so that the preview and the actual delivered result don't go through different calculations. The paragraph order, column arrangement, image ratios and responsive changes that the user confirmed on the reflow screen have to stay the same after they carry into EPUB editing. I organized things so that the result being observed and the result being edited come from one intermediate representation.</p>
<h2>Verification and Convergence</h2>
<p>Reviewing the conversion didn't end with eyeballing a few example pages. I first checked properties such as whether every paragraph enters the reading flow exactly once, whether the reading-order graph has no cycles, whether the sum of the column ratios stays within the available area, and whether resource references lie inside the closure. Before looking at the shape of the result, I checked the structural invariants.</p>
<p>In the responsive review, I sampled the environment space at many points. I checked not only the inside of each width range but both sides of the boundaries where the active constraints change, and crossed orientation, color state and text scale. I also verified that changing one axis preserves the state of the other independent axes, and that overlapping media predicates are evaluated with the intended priority.</p>
<p>For the typography and geometry review, I repeatedly converted headings and body text, multi-column structures, images and captions, background containers, decorative elements and complex visual material. I confirmed that text isn't clipped when the screen narrows, that the semantic order holds when columns change, and that the relationship between spacing and decoration doesn't collapse when the text size is raised. Even after re-editing a sentence in the EPUB editor, the reflow structure and media queries were recalculated correctly.</p>
<p>The whole conversion, which recovers the 2D coordinates of a fixed layout into a readable partial order, turns lengths into dimensionless constraints and extends the environment space into the Boolean algebra of media queries, was fully implemented and stabilized. A book made in the layout editor no longer stays on fixed pages; as HTML and CSS that preserve its structure and visual intent, it flows precisely into the next editing stage in the EPUB editor.</p>]]></description>
      <category>dev</category>
      <pubDate>Sun, 19 Jul 2026 01:38:36 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: A Spreadsheet for Table Images</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-17?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-17?lang=en</guid>
      <description><![CDATA[<p>After building the layout editor, I had to rethink how tables are handled. A table in a publication looks like a single image in the end, but while it is being made, its values, rows and columns, merges, alignment, fonts and borders keep changing. Pixels are only the final sample, and behind them there has to be related data and a set of typesetting rules.</p>
<p>I didn't start by bolting on a feature that draws table images. First I built a calculation model with cells, ranges, types and formulas, and made it regenerate the publishing scene from that state. The source of a table is neither a screen DOM nor an image; it is a sparse document that describes the relationships between coordinates and values. The screen and the output become different projections of that document.</p>
<p>Settling on this structure also made it clear that a plain HTML table isn't enough. Editing needs fast local access, formulas form a dependency graph, saving demands transactions and durability, and output has to compute geometry independent of the browser screen. A table editor is less a grid UI than a small computing environment where a relational model, a type system and sparse matrices meet.</p>
<h2>Sparse relation</h2>
<p>If a table is treated only like an image object, the very idea of a cell soon falls apart. Changing a single character would mean reinterpreting all the pixels, and sorting or filtering has no meaning on an array of colors. Rows and columns aren't just lines; they are an orthogonal coordinate system of records and attributes. The data came first, and geometry was just one way of showing it.</p>
<p>Mathematically, a sheet can be seen as a partial function defined on the product <code>R × C</code> of a row set R and a column set C. Since most cells are empty, a sparse relation that keeps only the coordinates with defined values is more natural than a dense matrix that materializes every coordinate. Cells that carry a style or a formula, not just a value, belong to the support set too. This is why the size of the screen and the size of the actual data are decoupled.</p>
<p>A column is not a mere coordinate but an attribute that shares one domain. A row is a tuple with several attributes, and columns with a role, such as title or date, become part of the schema. The order of rows and columns matters to the user, but it is separate from the identity of the relation. Only if the same tuples and attributes survive a reordering can various projections read the same data.</p>
<p>I also treated a merged cell not as a value duplicated across several slots but as a relation in which a single anchor owns a rectangular region. Merged regions must not overlap, and each region must contain exactly one anchor. Putting such invariants in the data model rather than in geometry lets the screen, the output and pasting all follow the same rules.</p>
<h2>Relational document</h2>
<p>A living table document fit the relational model well. Cell values, column schema, merges and styles are different relations, but they describe the same document through keys. Instead of rewriting one giant nested object every time, I can update only the tuples that changed, and range selection and sorting can be expressed as selection and ordering operations.</p>
<p>In the schema, I had to be clear about functional dependencies. The cell coordinate <code>(sheet, row, column)</code> determines the value and the formula, and the column identity determines the name and type. If two tuples with the same candidate key existed, there would be no telling which value is authoritative. Keys and uniqueness are not storage-technology options; they are part of the document's meaning.</p>
<p>Pushing normalization too far can make joins costly during editing. Conversely, duplicating all information into each cell means that renaming a column or changing a style leaves countless tuples holding different values. Balancing update anomalies against read locality, it made sense to split the relations and keep frequently co-read derived values as a cache projection.</p>
<p>Assets are large values outside the relations, but inside the reference graph they are vertices like any other. Assets owned by the document and assets shared from elsewhere have different lifecycles, and whether something can be deleted is judged by reachability from a root. By looking at relational integrity and graph reachability together, I made sure a change to one table never damages another document's assets.</p>
<h2>Gradual type system</h2>
<p>A column carries more meaning than a plain coordinate like A, B, C. Numbers, dates, booleans and categorical values allow different operations and have different sort orders. Yet if users had to declare every type up front, the free-form feel of typing into a table would vanish. What I needed was gradual typing, which bridges dynamic input and static schema.</p>
<p>A value whose type isn't settled yet stays as unknown, close to the top type, and a more specific candidate can be inferred from the inputs observed. When combining the types of several values, I look for the least upper bound that accommodates them all. Integers and reals can be merged into number, but dates and arbitrary strings can't be safely narrowed into one. The accidental shape of the first cell must not decide the whole column.</p>
<p>Changing a type is a migration, not an annotation change. I have to tell whether the conversion function <code>c: A -&gt; B</code> is a total function defined on every existing value or a partial function that fails on some. Quietly applying a partial coercion leaves a column mixing B with unconverted A. Only by computing the failure set first and letting the user choose does the relationship between schema and actual values stay honest.</p>
<p>A categorical column is like a finite set. A single choice is one element of the set, and a multiple choice is an element of the power set. Renaming an option isn't a simple string replacement; it has to be a bijection that renames an element of the domain. The display color is a projection separate from the value's identity. Keeping type and representation apart let the grid and other views share the same values.</p>
<h2>Selection geometry</h2>
<p>A cell selection is a region on the integer lattice <code>Z²</code>. A single cell is a point, and a rectangular range is a product of closed intervals defined by two endpoints. Separating the pixel rect on screen from the integer coordinates of the data keeps the meaning of a selection intact when zoom and scroll change. The UI overlay is merely the integer region mapped onto the current viewport.</p>
<p>When merged regions exist, a plain rectangular selection becomes a closure operation. If a selection S intersects a merged region M without containing all of M, it is expanded as <code>S &lt;- bbox(S ∪ M)</code>, and this repeats as long as the new boundary meets other merges. On a finite sheet S grows monotonically with each iteration, so it reaches a fixed point. The final selection is the smallest rectangle closed under every intersecting merge.</p>
<p>Hidden rows and columns exist in data space but can be treated as intervals of measure zero in display space. By building prefix sums of the cumulative column widths and row heights, I can quickly get a pixel position from a cell coordinate, and conversely find a cell from a pointer position by looking for the lower bound in that cumulative function. Hit testing on a grid with variable sizes was ultimately a search problem on a monotonic array.</p>
<p>Keyboard movement is a state machine with an active point and an anchor. A plain move shifts both together, while extending a range fixes the anchor and changes only the active point. Once text editing begins, the domain of the arrow keys switches from the grid to the string. By making explicit which space the same key operates on in each mode, I kept selection geometry and the text caret from colliding.</p>
<h2>Expression state</h2>
<p>A cell can hold a displayed value and its original expression at the same time. The formula <code>=A1+B1</code> is the source, and the number on screen is the value evaluated against the current dependency graph. If the source were overwritten by the value, the meaning of the next recalculation would be lost. The editing state had to separate the committed expression, the transient input and the evaluated result.</p>
<p>A formula parser turns a string into an abstract syntax tree and resolves cell references into symbols. If each formula cell is a vertex and each reference an edge, the calculation order becomes the topological order of the dependency graph. When a cycle exists, no order can be defined, so it must either be treated as an error or be given explicit iterative semantics. For ordinary spreadsheet calculation, an acyclic graph was the most predictable.</p>
<p>The composing string of a Korean IME is similar to a transient expression. If input that hasn't been finalized is committed to the document source, the same jamo (Korean letter component) can be entered twice, or an intermediate string can slip through to the formula parser. While composing, the value owned by the IME should be shown only on screen, and the source should be updated in a single transaction after the commit transition.</p>
<p>Recalculation can target only the dirty subgraph. When cell x changes, only the dependent set reachable backward from x needs to be re-evaluated, and independent components aren't affected. By binding input commit, graph evaluation and screen projection into one revision boundary, formulas and multilingual input came to live inside the same state model.</p>
<h2>Sequence algebra</h2>
<p>Copy and fill are operations that map a two-dimensional submatrix to another position. For copying values alone, a translation is enough, but the relative references in a formula have to change with the displacement vector. Once absolute and relative references are distinguished, the coordinate terms of the formula AST can be transformed affinely.</p>
<p>Pasting is the process of merging an external matrix into a typed relation. For each column domain, I have to check that the value belongs to it and that the necessary coercion is total. Whether to reject the whole transaction when some cells fail, or to apply only the parts that can succeed, is an atomicity policy. Making the failure set and the extent of what was applied explicit protects the meaning of the data better than a silent partial success.</p>
<p>Auto-fill is the problem of inferring a generating rule from a short sequence. If the first difference of a numeric sequence <code>a_n</code> is constant, I can suspect an arithmetic progression, and if the ratio is constant, a geometric progression. A sequence with a constant second difference can be explained by a quadratic polynomial. But infinitely many generating functions fit a finite sample, so a criterion of Occam's razor is needed to choose the simplest rule.</p>
<p>Dates and text suffixes have their own algebras. Dates differ from plain integer addition because of the calendar's variable month lengths, and strings have to be decomposed into a prefix and a numeric part. When no rule can be inferred, the fill falls back to the most conservative transformation, repetition. Fill is a small automation feature, but it only became a predictable tool once it understood types and the sequence model together.</p>
<h2>Sparse style tensor</h2>
<p>Cell formatting is data just like values, but most of it is default. It can be seen as a sparse tensor defined on the product <code>R × C × P</code> of rows R, columns C and properties P. If only the properties that differ from the default are stored for a given cell, the cost of an empty table doesn't grow with the number of cells. Keeping only the support of a partial function is more natural than duplicating a whole style object.</p>
<p>The final style is obtained by composing the document defaults, the column and row styles and the cell overrides. Each layer is a per-property partial map, and the definition from the nearest scope wins. Identical style sets that recur can be shared like a flyweight, but mutating a shared object directly changes many cells at once. Immutable style values and structural sharing fit well together.</p>
<p>A number format is a function from the original value to a display string. Writing it as <code>format: Value × Locale × Pattern -&gt; String</code> means sorting and formulas use the original value, while the screen and the output alone share the same formatter. Reinterpreting the display string as a number loses information because of currency symbols and decimal-point locales. It was a textbook case of separating value from representation.</p>
<p>Mathematically, it is more accurate to treat a border as a property of a grid edge than of a cell. Two adjacent cells share only one edge, and if both cells carry their own stroke, conflicts and double lines appear. Seeing the grid as a planar graph and assigning styles to edges lets merges and outlines be described within the same topology.</p>
<h2>Ownership graph</h2>
<p>Images and fonts are visible inside cells, but they have a different lifecycle from the value itself. Rather than duplicating a large binary into every cell, it is better to create an asset vertex and let cells hold reference edges to it. The same image can be used by several cells, and styles and output can share the same font vertex. The document becomes a combination of a relational table and an asset graph.</p>
<p>Ownership and reference are not the same thing. Just because document B reads an asset made by document A doesn't mean B gets the right to delete it. Only by distinguishing strong ownership edges from borrowed references can I tell which assets disappear along with the root document when it is deleted. Asset lifecycle was a matter of capability and reachability rather than a simple file list.</p>
<p>While undo points to a past revision, an asset that has vanished from the current screen is still reachable. If only the current revision is marked, values needed for redo get collected too early. The live roots must include not only the current document but also the preserved history and any snapshot being exported. The correctness of garbage collection depended on what is defined as a root.</p>
<p>Fonts affect geometry too. If measurement happens with fallback metrics before the asset is ready, row heights and line breaks change. So resolving a font reference isn't preparing a visual decoration; it is settling an input to layout. Only after certain vertices of the asset graph reach the ready state could the typography projection be regarded as the authoritative result.</p>
<h2>Serializability</h2>
<p>For undo in table editing, restoring cell values alone wasn't enough. When a column type changes, values, formulas and views are all affected, and inserting a row shifts merges and reference coordinates. A single user command changes several relations, so atomicity like that of an ACID transaction is needed. A state in which only some writes are visible is not a valid table.</p>
<p>If two actions read the same previous revision and each writes its result, a lost update can occur. Serializability has to be guaranteed so that the result is equivalent to some sequential order. The simplest way is to commit commands one at a time, and if more parallelism is wanted, I can check whether the read sets and write sets conflict.</p>
<p>Formula recalculation and view projection are work derived from the base transaction. A result computed against base revision r that arrives late on top of r+1 is a stale result. By attaching the source revision to every derived result and discarding it when it differs from the current revision, the screen never slips back to past values. Even asynchronous rendering needed the same time model as snapshot isolation in a database.</p>
<p>History is movement between committed revisions. Snapshots restore quickly but are large, while an operation log is small but sensitive to inverse operations and schema changes. For compound changes to a table, mixing semantic commands with partial snapshots was the right approach. I separated on-screen responsiveness from durable history, while making both point to the same revision graph.</p>
<h2>When Saving Is Done</h2>
<p>Saving is finished not at the moment the write function is called but at the moment there is proof that a particular revision has become durable. Excluding transient input on screen and derived values still being computed, the committed base state and the asset graph it needs must form one consistent snapshot. The durability boundary had to be defined independently of the UI lifecycle.</p>
<p>A new revision can appear during saving, so the revision r at the start has to be compared with the current revision at completion. Even if r has become durable, when the current revision is r+1 I can't say the latest state has been saved. Rather than letting concurrent writes race, it is easier to explain the ordering by completing r and then checkpointing the newest revision again.</p>
<p>Closing isn't simply an event that removes the screen; it is a state transition that passes through the last input transaction and a durability barrier. If an unfinalized composition or expression remains, it must first be committed or rolled back, and if saving hasn't succeeded, the previous durable revision must remain valid. I separated the UI going away from the end of the data's lifetime.</p>
<p>I repeatedly reviewed cell input, multiple writing systems, formula dependencies and cycles, type migration, bulk matrix operations, merge closure, the asset graph, consecutive undo and new revisions during saving. I confirmed that the relational source state, the screen projection and the durable snapshot all point to the same revision. The spreadsheet engine, which manages the source of publication tables while you edit them directly, was fully implemented and stabilized.</p>]]></description>
      <category>dev</category>
      <pubDate>Sat, 18 Jul 2026 11:53:10 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: One Dataset as Table, Board, Calendar</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-18?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-18?lang=en</guid>
      <description><![CDATA[<p>Once spreadsheet editing was done, what remained was deciding what results to show that data as. With typed columns and stable records in place, there's no reason to look at the same relation only as a table. A categorical attribute can become the partition of a kanban board, and a date interval can become the time axis of a calendar. A screen isn't the data; it's a query applied to the data.</p>
<p>I didn't build the grid, the kanban board and the calendar as separate documents. I applied selection, grouping, ordering and projection to a single base relation to produce different views. Whichever screen a value is changed on, the change goes back to the base tuple, and the other views reinterpret the same revision. It was more accurate to see this as closed operations of relational algebra than as copying data.</p>
<p>I didn't produce the output by capturing the screen, either. A separate scene graph is built from the view's semantic structure, and vector and raster output are the result of sampling that graph. Even when the screen size and theme change, the original relation stays the same and only the layout constraints change. This is how the table editor grew from a data entry tool into a maker of visual material for publishing.</p>
<h2>Relational projection</h2>
<p>A view is the combination of a projection <code>π</code> that picks only the needed columns from one relation T, a selection <code>σ</code> that picks the rows meeting a condition, grouping by category, and an ordering <code>τ</code>. The grid is a projection close to T, while the kanban board and the calendar are the results of stronger transformations. As long as a view doesn't copy the base tuples, there's no need to reconcile the consistency of several screens separately.</p>
<p>A view isn't a completely stateless function, though. Which attribute to use as the axis, which properties to display and the order the user set are all query parameters. Keeping these as a declarative query distinct from the base data lets me recompute the same view from the same relation. The screen DOM is only a temporary materialization of the query result.</p>
<p>A materialized view is fast to read but has to be updated when the base changes. I could recompute the whole view on every change, or use incremental view maintenance that applies only the delta. By computing algebraically how inserts and deletes affect grouping counts and sort order, I can update only the changed parts even on a large relation.</p>
<p>What mattered was that an edit started from any screen gets translated into a transaction on the base relation. If card moves and schedule changes were stored as separate state, they would conflict with the grid, but reduced to attribute updates on the base tuple, every view reads the same revision. “One table, many views” was a principle about the oneness of data more than about UI composition.</p>
<h2>Identity and Permutation</h2>
<p>The positions of rows and columns change under permutations, but identity has to be preserved. n ordered items can be rearranged by a permutation in the symmetric group <code>S_n</code>, and if a view uses the coordinate index as the identity, a single permutation changes the meaning of every reference. Separating an object from its current position was the foundation of multiple views.</p>
<p>A tuple in a relation can have a surrogate identity, and attributes can be handled as symbols independent of display order. Sorting is merely a total order defined over a set of identities. Inserting a new item in the middle changes the order relation but not the equivalence of existing identities. That is why a database key and a screen coordinate are different things.</p>
<p>A user's ordering can carry a stronger meaning than a mere sort result. A record the user created has to exist even if its values are empty, and the order in a particular view may not be recomputable from base values alone. Separating the existence set from the order relation lets me account for empty records and user-defined order together.</p>
<p>For undo and migration, too, what has to be preserved is not numeric coordinates but this identity and these relations. If the correspondence of objects before and after a permutation holds, the attributes and tuples a view refers to remain stable. The principle of not using screen coordinates as permanent identifiers meant the same thing in every editing system, not just in tables.</p>
<h2>Quotient and Order</h2>
<p>A kanban board is a projection in which a categorical function <code>g:R-&gt;K</code> divides the row set R into a set of lanes K. If rows with the same g value are regarded as equivalent, then <code>r1 ~ r2 iff g(r1)=g(r2)</code>, and the lanes become the equivalence classes of the quotient set <code>R/~</code>. Values that belong to no category also have to be treated as one explicit class, so that the partition covers all of R.</p>
<p>Multiple categories are closer to an incidence relation than an equivalence relation. A card can belong to several lanes at once, so this becomes a bipartite graph with <code>M ⊆ R × K</code>. Moving a card is an operation that adds or removes edges, and whether to keep the edges of other categories or replace them all depends on the meaning of the command.</p>
<p>The order of cards within a lane sometimes follows from the values automatically, but it can also be a total order set by the user. If the order is stored as integer indices, every later item has to change on a mid-list insertion. One could think of fractional indexing, which assigns an order key between two neighbors, or a linked order, but they bring density of the key space and rebalancing costs. Even order itself was a data structure.</p>
<p>Drag and drop translates a screen position into this relation update. It finds the nearest order interval from the pointer's continuous coordinates, and updates the lane membership and the order in a single transaction. If only the membership changed first, the card would briefly vanish, and if only the order changed, it would corrupt the order of another lane. One UI gesture was an operation that changes the quotient and the order relation at once.</p>
<p>The properties visible on a card are a projection of the base tuple. There is no need to build the kanban board as a separate document model. When every action that edits the title, status or date reduces to an update of the original tuple, the grid and the calendar read the same values from the same revision right away. The kanban board became a structured query over the relation, not a board that duplicates data.</p>
<h2>Interval algebra</h2>
<p>In a calendar, an event is not a point but an interval on the time axis. With a start s and an end e, defining it as a half-open interval like <code>[s,e)</code> means a one-day event and an event starting the next day don't overlap at the boundary. Treating date-only values and time-zoned instants as the same kind of number can make the meaning shaky under daylight saving and locale, so the time domain has to be decided first.</p>
<p>The relation between two intervals is richer than merely whether they overlap. Allen's interval algebra has basic relations such as before, meets, overlaps, during, starts and finishes. To place events into lanes on a monthly view, intervals that overlap each other can't use the same lane, and the minimum number of lanes can be thought of as interval graph coloring.</p>
<p>Moving an event is an operation that applies the translation <code>T_Δ([s,e))=[s+Δ,e+Δ)</code> to the interval. A move that has to keep the length and a resize that changes one boundary are different transformations. The invariant that the end can't come before the start has to be kept, and the algebra of Δ also differs depending on whether the calendar unit is day or time. A drag in the UI had to be translated into an exact function over a time interval.</p>
<p>Color and title are projections independent of the interval geometry. Per-row overrides, category styles and global defaults can pick the nearest definition like a cascade. When the screen and the output use the same style resolution, the same event relation yields the same visual meaning.</p>
<p>The calendar wasn't a separate event database either. The source of an interval is the base tuple, and edits go back as updates to the date attributes. Even when several events share the same title, identity lives in the tuple, not in the string. On the surface it's a card on a time axis, but computation and history stayed as transactions on the original relation.</p>
<h2>Concurrent materialization</h2>
<p>View materialization is a combination of asynchronous querying and rendering. A slow computation started at revision r can finish later than a fast computation at revision r+1. Completion time is not evidence of freshness, so a result has to carry the source revision and query parameters it came from. A result that doesn't match the current revision can't be committed.</p>
<p>This is the same as optimistic concurrency control. A job builds an independent candidate scene without locking the shared screen, and at the final commit it checks whether the revision it read is still valid. If it is, the scene is swapped in all at once; if not, the candidate is discarded. The user sees only either the previous complete screen or the new complete screen, never an intermediate scene.</p>
<p>When rendering needs actual viewport measurement, the compute phase and the commit phase can still be kept apart. I prepare the structure and styles first, and evaluate only the minimal part that needs live geometry right before the commit. When measurement alternates with DOM writes, the cost of forced layout grows, so batching reads and writes separately was important.</p>
<p>When leaving a view, the resources of the materialized scene also reach the end of their lifetime. Resources registered at runtime, such as event listeners, external resource handles and observers, aren't all cleaned up automatically just because the garbage collector removes the screen tree. I treated the view lifecycle as a resource scope in which acquisition and release come in pairs.</p>
<p>However the base relation changes, the current view applies the same query to the new revision. The UIs never call each other directly; they meet through a revisioned dataflow. Even with many projections attached to one piece of data, the structure keeps lifecycle and asynchronous completion order from interfering with each other.</p>
<h2>Scene graph rendering</h2>
<p>For table images, it was more accurate to build a fresh scene graph from the relation than to capture the editing screen. The editing UI is mixed with state that has no meaning in the output, such as selection, inputs and scroll. The output graph should have only primitives that carry document meaning, such as cell backgrounds, text, images and borders. Once source and projection are separated, viewport and zoom no longer change the result.</p>
<p>The prefix sums of row heights and column widths turn grid coordinates into continuous geometry. The start of column j is <code>x_j = Σ_(k&lt;j) w_k</code>, and the start of row i is <code>y_i = Σ_(k&lt;i) h_k</code>. A merged region gets its width and height from the sums over its span. This cumulative coordinate system makes each cell's box deterministic even in a table with variable sizes.</p>
<p>The order of the scene graph follows the painter's algorithm. Because a primitive drawn later is composited on top of earlier results, the order of background, fill, content and edge decides the visual meaning. With transparency it is not a simple set but an ordered sequence, and a clip acts as a state that restricts the domain of subsequent primitives.</p>
<p>Thin lines are delicate between continuous geometry and the pixel grid. Depending on whether the center of a line falls on a half pixel, which way the stroke spreads, and the output scale, one line can straddle two pixels. I have to keep exact edges in vector coordinates and take the device transform and stroke alignment into account at the rasterization stage.</p>
<p>The preview and the output observe the same scene graph through different cameras. Zoom and pan change only the view transform, not the graph. If the scene is rebuilt only when the content changes and the viewing magnification is left alone, the editing screen and the published result can share a single geometric model.</p>
<h2>Shaping geometry</h2>
<p>The width of cell text isn't proportional to the number of characters. A Unicode sequence goes through shaping to become a glyph sequence, and ligatures, kerning and script-specific substitution determine the actual advance. Even the same character can produce a different glyph and position depending on the font face, language and direction. Typography geometry had to start from the shaping result, not from the string length.</p>
<p>The width of a line is the sum of glyph advances and positioning adjustments. Line-break candidates have to follow each language's line breaking class and grapheme boundaries, and the rules differ among Korean, CJK and whitespace-based languages. Cutting between arbitrary code units can break combining characters and emoji sequences. Text segmentation was a linguistic step that comes before geometry.</p>
<p>Row height is determined by the sum of line boxes plus padding, but the actual ink bounds can extend beyond the line box. To avoid clipping italic overhang, diacritics and underlines, advance geometry and visual geometry have to be distinguished. In a merged region several rows share their heights, so how one cell's required height gets distributed among the rows becomes its own constraint.</p>
<p>If the preview and the final output use different text engines, line breaks can differ even at the same font size. So the shared inputs, namely the font file, shaping features, language and metrics, have to be fixed, and the results of the two renderers compared at the level of glyph positions. Equality of plain CSS strings doesn't guarantee equality of typography.</p>
<p>An ellipsis is likewise a search problem that exploits the monotonicity of prefix width, not a trick of removing characters one at a time until they fit the remaining width. I find the largest boundary at which the shaped prefix width stays within the limit, taking the advance of the ellipsis glyph into account. By using only correct boundaries as candidates, even across multiple writing systems and combining sequences, the text inside tables was typeset stably.</p>
<h2>Planar Edges and Closure</h2>
<p>Grid lines aren't independent rectangles per cell but the shared edges of a planar graph. Two adjacent faces own the same edge, so only one stroke should be decided for it. If each cell draws its own border separately, the same edge is duplicated and two styles conflict. It was more accurate to build the topology first and perform edge style resolution once.</p>
<p>Merging is a graph contraction that collapses several faces into one larger face. The internal edges are removed and only the outer boundary remains. By taking the perimeter of the rectangular merged region and applying the style to its outer edges, the interior lines of the pre-merge cells never show up in the output. Table border problems were explained more simply by graph topology than by CSS exceptions.</p>
<p>A stroke spreads to both sides along the center of the path, so the geometric boundary and the visual boundary differ. An outline of width t relates to the Minkowski sum of the original region and extends outward by <code>t/2</code>. To fit all of it inside the output box, I have to enlarge the clip or offset the path inward. The problem of the viewBox being cut off depending on line thickness can also be solved with the same geometry.</p>
<p>For an output scene to be an independent document, the transitive closure of the assets it references must come along. If the scene needs image A, A needs color profile B, and the text needs font C, then every vertex reachable from the root must be collected. It was a problem of computing the closure of a dependency graph rather than a trick of inlining a few files.</p>
<p>I separated asset names from runtime addresses as well. A handle from the current session has no meaning in persistent output, and references inside a scene need an identity that can be resolved again within the package. By checking closure and referential integrity before output, I got a self-contained scene in which no images or fonts go missing.</p>
<h2>Responsive partition</h2>
<p>If a wide table is simply shrunk onto a small screen, the text and the columns become too small to read together. A responsive table wasn't a scaling problem but a partition problem over the column set. A key column that identifies meaning can be repeated in each piece, and the remaining attributes divided into several blocks stacked vertically.</p>
<p>When the column set C is divided into k order-preserving subsets, the width of each block and the height of the whole stack change. If the target aspect ratio is ρ, the cost of a candidate partition P can be built from <code>|W(P)/H(P)-ρ|</code>, the imbalance between blocks and the cost of repeated columns. It becomes an optimization that searches k and the boundary positions together to pick the partition that fits the screen.</p>
<p>Semantic relationships between columns can go into the cost too. Values that are read together cost less when placed in the same block, and a very wide column may be better off alone. This can be solved with sequence-partition dynamic programming. By storing the minimum cost of splitting up to a prefix into j blocks, I don't have to enumerate every possible division.</p>
<p>Theme conversion isn't simply inverting colors. I have to distinguish the semantic colors the user specified from the system defaults, and preserve the relative luminance and contrast between background and foreground. Computing the contrast ratio from relative luminance rather than sRGB channel values, and mapping only the default colors to another palette, preserves the design.</p>
<p>Every variant must come from the same relation and the same scene builder. Data, typography and asset closure are shared, and only the viewport constraint and the palette change as parameters. Without building a separate condensed renderer, the responsive output kept the meaning and style of the original table.</p>
<h2>Sampling pipeline</h2>
<p>Turning a vector scene into a raster image is sampling continuous shapes onto a finite grid. Once the output width and height are set, what area of the scene each pixel represents is determined, and naive point sampling can produce aliasing on thin lines and small text. It is more accurate to integrate the color over the pixel footprint, or to supersample sufficiently and then downscale with a low-pass filter.</p>
<p>A transparent background and an opaque output are also different compositions. An output that preserves alpha can record premultiplied color and coverage together, but an opaque format has to be composited first against a background color B with <code>C = αF + (1-α)B</code>. Compositing directly in gamma-encoded channels changes the brightness at edges, so I compute in linear-light space where possible.</p>
<p>Splitting a vertically long scene into several images is pagination of the row sequence. Each piece shares the same column geometry and styles, and the header becomes a repeated template. With the maximum height and semantic units as constraints, dividing the row intervals lets a single-piece output and a split output use the same scene builder.</p>
<p>The kanban board and the calendar also build their scene graphs from their own relational structure, not from the screen DOM. The kanban board projects quotient classes and order into lane geometry, and the calendar projects the result of interval graph coloring onto a time grid. Since the screen and the output use the same base relation and the same mathematical projection, there are no differences caused by the capture environment.</p>
<p>A final asset isn't finished with just the completed result. Only if it records which relation revision, query, viewport and palette it was generated from can it be edited and regenerated later. What mattered in the publishing pipeline was keeping the semantic link between result and source, more than how a large binary gets moved around.</p>
<h2>Round-trip equivalence</h2>
<p>Even when a raster result goes into a publication, the editing source behind it has to remain as a relation and a query. An image's pixels are a projection computed at a particular revision and are not equivalent to the source document. Linking the result and its provenance lets the reader see a stable picture while the maker can return to the original data.</p>
<p>I defined the correctness of the round trip by semantic equivalence rather than byte identity. If the original state x is sent through a render R and then through an operation O that opens the editing source again, it's impossible for <code>O(R(x))</code> to restore x completely, because rasterization loses information. Instead, I let the resulting asset point to x through a separate provenance edge, so I find the source directly rather than guessing an inverse transformation.</p>
<p>When applying the result of a new revision to an existing layout object, I separate identity from value. The position on the page and the user's placement stay on the identity side, while the new scene's aspect ratio and pixels are replaced as the value. The replacement has to be applied atomically after the completed candidate has been verified, so that the previous healthy result doesn't disappear in a mid-way failure.</p>
<p>I reduced both actions performed by a person in the UI and automated input to the same typed commands. Every command that changes the base relation passes through types, invariants and transaction boundaries, and the views and outputs materialize the new revision again. Since I didn't build a separate modification path for each input method, the same mathematical contract held.</p>
<p>I repeatedly reviewed tuple changes among the grid, kanban board and calendar, quotient and interval transformations, consecutive asynchronous materializations, multiple viewports and palettes, font and image closure, long-table partitions and source round trips. I confirmed that the data on screen, each scene output and the results placed into publications all point to the same revision. The table production system, which turns one table's data into several publishing formats and then returns to editing the source, was fully implemented and stabilized.</p>]]></description>
      <category>dev</category>
      <pubDate>Sat, 18 Jul 2026 11:53:10 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: A Publisher for Books on the Web</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-19?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-19?lang=en</guid>
      <description><![CDATA[<p>After building the table editor, I turned back to the last stretch of the road along which finished content reaches readers. Letting people download an EPUB file or register it with a distributor wasn't enough. A book made in the editor had to be publishable straight to the browser without building a separate website, and its structure and behavior had to appear intact on both mobile and desktop.</p>
<p>I had no intention of building a feature that merely converts an EPUB into a few HTML pages and uploads them. That approach keeps the body text but loses the page turning, spreads, dark mode, chapter navigation, margins and layout set in the editor. For fixed-layout documents made in the vector and layout editors, it is even more direct. If the ratios, the time axis and the relationships between pages aren't preserved, the web post becomes a different document from the original.</p>
<p>So I built the Publisher not as a mere output window but as an independent document editor. What mattered was not which data goes where, but whether the document observed while editing and the document observed while reading are the same. I defined this problem not as copying a screen but as preserving meaning between two execution environments, and reorganized the whole Publisher on top of that definition.</p>
<h2>Publication state</h2>
<p>Mathematically, publication state can be thought of as a product space of a content set \(C\), presentation rules \(S\), a navigation structure \(N\) and an execution environment \(E\). A published document is \(p=(c,s,n,e)\in C\times S\times N\times E\), and the renderer is a function \(R:P\to O\) that maps this state to an observable screen. Here the correctness of publishing is decided less by the fact that a file exists than by whether \(R(p)\) has the same meaning in the editor and in the public environment.</p>
<p>If I demanded identical pixels, I couldn't handle different screen sizes. Conversely, if I defined it loosely as just the same meaning, I could claim it's the same document even when margins, spread behavior or page order differ. So I split equivalence into layers. Content equivalence of text and assets, order equivalence of reading order, structural equivalence of layout constraints and transition equivalence of interactions must all hold before I count something as the same publication.</p>
<p>The key is never to treat any one component of the state as a temporary by-product of another. Navigation state isn't a side effect of layout, and presentation rules aren't decoration mixed into the content string. Each is an independent coordinate axis, yet they act together in the final observed value. Once this product-space model is in place, the invariant that changing one axis must preserve the others comes out naturally.</p>
<p>The editing process of the Publisher is also, in the end, a transition that sends a state \(p_t\) to the next state \(p_{t+1}\). Collecting only the allowed transitions yields a state machine, and at boundaries like saving or publishing, the invariants must hold before and after the transition. I organized the actual implementation without damaging this mathematical model, and thanks to that the Publisher's semantics stayed one even as various documents came in.</p>
<h2>Orthogonal State Space</h2>
<p>If document state is treated as one lump, it's hard to compute the scope of a change's impact. Some edits affect only the body, some only the presentation, and some only the order. Viewing this as a vector \(x=(x_1,x_2,\ldots,x_n)\), a good decomposition is like choosing a basis in which each coordinate has as little correlation as possible. If a change in one coordinate forces every coordinate to be rewritten, the basis was chosen wrongly.</p>
<p>I separated state by lifecycle and meaning, so that components with different rates of change aren't forced into the same update cycle. A long-lived identity and a frequently changing presentation value, or a value derived from the source and a value the user decided directly, aren't on the same time scale. Placing them on nearly orthogonal axes makes the change vector \(\Delta x\) sparse, so only the parts actually affected need to be computed.</p>
<p>Of course, real state isn't perfectly orthogonal. When the reading order changes, the interpretation of the current position changes too, and when screen conditions change, the same presentation value gives a different result. So rather than independence, it is more accurate to express conditional dependencies as a graph. With state components as vertices and only direct influences as edges, I can obtain the closure a change produces and cut unnecessary full recalculation.</p>
<p>Saveability can be explained within this structure too. If I map the state to a normal form \(\nu(x)\) and let representations with the same meaning converge to one canonical value, I get idempotence: \(\nu(\nu(x))=\nu(x)\). Values that differ only in notation, such as color notations, out-of-range numbers or legacy settings, stop wobbling no matter how many times they are loaded and saved. The document's long-term stability came from the properties of this normal form rather than from some huge save function.</p>
<h2>Flow and Fixed Semantics</h2>
<p>The documents the Publisher handles fall broadly into two different semantic domains: flowing documents and fixed-layout documents. In a flowing document, position is a function recomputed according to screen conditions, whereas in a fixed-layout document, position is a value belonging to the original coordinate system. If both are interpreted with the same coordinate semantics, one of them is bound to be damaged.</p>
<p>In type-theoretic terms, the document space isn't a simple set but a sum type \(D=D_{flow}+D_{fixed}\) with different generation rules for each side. The layout operation of a flowing document is a re-typesetting function that depends on width and font metrics, while the layout operation of a fixed-layout document is a transformation that maps original coordinates to screen coordinates. Even when a common interface exists, I must not assume the internal semantics are the same.</p>
<p>What the two formats have in common are abstract operations: moving a page forward or backward, entering a particular logical unit and getting the current observation state. How pages get made, on the other hand, differs. This difference is closer to an algebraic data type than to an object-oriented class split. Common operations are defined on both types, while operations closed within each type must be performed only inside its own semantic domain.</p>
<p>Once this distinction was clear, I could handle responsive documents and graphic documents in one Publisher without either one's rules intruding on the other. I didn't make them share the same computation just because the same button appears, and I didn't assume they were the same document just because they have the same output format. For the user it is a single reading experience, but internally the math was finished to keep two correct semantics.</p>
<h2>Constraint geometry</h2>
<p>Laying out pages in the preview wasn't a matter of picking a fixed size but of optimizing an objective function under constraints. If the available screen area is \(W\times H\) and the width and height of a page are \(w,h\), the basic objective is to make the page area \(wh\) large. At the same time, inequality constraints such as outer margins, the navigation area, the gap between pages, the aspect ratio and a minimum readable width must all be satisfied.</p>
<p>So the set of feasible layouts can be written as \(\mathcal{F}=\{(w,h):g_i(w,h)\leq0\}\), and the actual layout can be seen as \(\arg\max_{(w,h)\in\mathcal{F}}wh\). When the aspect ratio is fixed, the degrees of freedom drop to one, but a single page and a spread have different constraint equations themselves. This is also why the topology of the optimal solution changes when the screen width crosses certain boundaries.</p>
<p>Switching layout modes isn't a plain conditional but a piecewise optimization. Within each interval the solution moves continuously, but at the points where the set of active constraints changes, it jumps into a different solution space. To keep the page from jumping or intruding on the navigation area at those boundaries, I had to look not just at each interval's objective function but also at continuity at the boundaries.</p>
<p>Mobile and desktop aren't two separate designs forced together, either. I saw them as the same semantic variables having optimal solutions in different feasible regions. So even when the screen changes, the document's content and order stay the same, and only the geometric solution moves to fit the new constraints. I organized the Publisher's responsive preview so that this constraint system converges stably.</p>
<h2>Aspect-ratio fitting</h2>
<p>A fixed-layout document has to preserve the aspect ratio of its original coordinate system. If the original width and height are \(a,b\) and the available area is \(W,H\), the uniform scale is \(s=\min(W/a,H/b)\) and the resulting size is \((sa,sb)\). This looks like a plain contain calculation, but once margins and auxiliary areas come in, the actual available area has to be defined precisely first.</p>
<p>If the inner margins are \(p_x,p_y\), what has to match the ratio is not the outer box but \((w-p_x,h-p_y)\). That is, \((w-p_x)/(h-p_y)=a/b\) must hold while the whole box fits inside the available area. In a spread, the two pages with the same constraints and the gap between them have to be treated as one composite shape, so I pick the stricter of the candidates from the width constraint and the height constraint.</p>
<p>Centering isn't about using the center of the whole screen, either. After excluding the area taken by auxiliary panels, I need the center of the remaining feasible rectangle. Which direction the auxiliary area sits in changes the reference origin, but the calculation itself can be unified as an affine transformation on the remaining area. Separating translation from uniform scaling lets me verify ratio preservation and position preservation independently.</p>
<p>I applied this geometric model repeatedly to portrait, landscape and square originals, and to single-page and spread conditions. Including rounding errors at the edges, I confirmed that the original is never cropped and the center never drifts, and a fixed-layout document no longer loses its own coordinate system on any screen.</p>
<h2>Reading order</h2>
<p>A book's reading order isn't the same as sorting file names. Logical precedence, the order shown to the reader and the position the current screen refers to are different coordinate systems. I viewed the order the original has as a total order \((S,&lt;)\), and interpreted the user's rearrangement and private selections as a permutation and a subset selection acting on top of it.</p>
<p>If the element set is \(S\), the public subset the user chose is \(V\subseteq S\), and the rearrangement is a permutation \(\pi\in\mathrm{Sym}(S)\), the actual reading order is the projection of \(\pi(S)\) onto \(V\). Hiding isn't deleting an element but excluding it from the observed set, and rearranging is an order transformation that doesn't change an element's identity. Only by separating the two can I find the same chapter again when it's re-published later or the original is updated.</p>
<p>When the original changes, the correspondence between the two ordered sets has to be recomputed. If I match by array position, the moment one element is inserted at the front, every relation after it goes wrong. If I instead construct a partial isomorphism based on stable semantic identities, the relations among common elements are preserved, and only new and removed elements need handling at the boundary. This is closer to preserving order structure than to a plain merge.</p>
<p>I placed first entry and next/previous movement on the same order space too. When the arrangement of buttons on screen, the current position and the logical coordinates of the actual document are connected by a single order map, the result is the same whichever side you move from. The reading order doesn't break through repeated cover hiding, chapter rearranging and mid-list insertions because this order-theoretic invariant was held to the end.</p>
<h2>Navigation projection</h2>
<p>The chapter navigation UI isn't a copy of the reading order but a projection of the order space onto the screen. A vertical list and a horizontal list aren't different data structures; they are the same permutation laid out along different axes. If the direction vector is \(u\), the position of each item can be compared by the scalar projection \(x_i\cdot u\), and the algebra of the order doesn't change even if the screen orientation does.</p>
<p>For per-device presentation values, I didn't just scale a single number up or down. If I write the presentation state over a set of environments \(E\) as a function \(s:E\to V\), then mobile and desktop are not abridged versions of the same state but values corresponding to different elements of the domain. It is far more stable to share common values explicitly and leave environment-dependent values at their own coordinates.</p>
<p>When there are very many items, exposing every element at the same visual density actually raises the cost of navigation. If the amount of information needed is \(I\) and the amount a screen can hold is \(B\), the navigation interface needs a compressed representation to reduce \(I/B\). By keeping only the high-value operations, such as the current position, the boundaries and direct jumps, the cognitive load stays almost constant even as the number of elements grows.</p>
<p>Applying this principle, I made sure the meaning of navigation doesn't change when the size of the document or the screen orientation does. The presentation can be compressed or change direction, but the order space that selection and movement act on is the same. Chapter editing in the Publisher became a stable tool for handling permutations and projections, not a UI effect.</p>
<h2>Render convergence</h2>
<p>Rendering mixes different time axes, such as fonts, images, layout measurement and user input. These events don't occur in one complete chronological order. Some events must come before others, but many are independent of each other. So it is more accurate to view execution not as a single timeline but as a partial order \((E,\prec)\), and to preserve only the happens-before relations that affect the result.</p>
<p>The problem is when an old computation finishes late and overwrites the latest state. If the state version is \(v\) and the version the result computation started from is \(v_r\), the condition for applying a result is at least \(v_r=v\). There's no need to expose every intermediate state on screen either. When several changes overlap within a short time, I keep only the computation the final state requires, so that the observable result matches the latest intent.</p>
<p>Render completion doesn't mean a single asynchronous task has finished, either. Only when applying the layout function \(L\) repeatedly reaches a fixed point near \(L(x)=x\) and the required resources have become observable can the screen be revealed. But I can't wait for external resources forever, so a convergence condition and a bounded-wait condition have to be set together. It means waiting for completeness without giving up the system's liveness.</p>
<p>I made this part independent of any particular execution order. Even if events arrive in a slightly different order, the final state is the same, and even when settings or the screen size change rapidly in succession, only the last intent remains, accurately. The stability of rendering came from keeping the partial order and version invariants, not from speed.</p>
<h2>Temporal identity</h2>
<p>To be able to say it is the same published document after the source has been edited, identity and the time of the content have to be separated. The document's value can change as \(V(t)\) at time \(t\), but the identity \(I\) that refers to the document persists. If sameness is defined as complete equality of values, every edit makes a new document, and if sameness is defined by name alone, different documents collide.</p>
<p>So I saw a document as a trajectory \((I,V_t)\) that changes over time. An update isn't an operation that changes the identity but one that maps a new valid state to the same identity. Values that must be kept independently of the source, such as presentation settings and reading order, are preserved within this trajectory, and only values that must be re-derived from the source are computed against the new state.</p>
<p>Results made in several editors were interpreted as a provenance graph between source and result. What matters isn't the concrete round-trip path but which result was derived from which point in which source. With this relation as a directed graph, I can explain update authority and the scope of influence, and structurally block circular references and changes of unclear origin.</p>
<p>I repeatedly reviewed flowing and fixed-layout documents, portrait and landscape formats, single pages and spreads, mobile and desktop, hiding and rearranging chapters, and consecutive state changes and source updates. I confirmed that in every condition, content equivalence, order equivalence, layout constraints and interaction transitions are preserved consistently. The Publisher engine, which edits a book's structure into a reading experience on the web, was fully implemented and stabilized.</p>]]></description>
      <category>dev</category>
      <pubDate>Sat, 18 Jul 2026 11:53:10 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: Publishing the Edit View to the Web</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-20?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-20?lang=en</guid>
      <description><![CDATA[<p>After finishing the Publisher's preview and design state, I built the publishing system that moves that screen to a real public URL. The goal here was clearer than just uploading files to a server. The workspace I checked in the editor had to run on the browser's public page with the same size calculations, the same chapter navigation, and the same theme and responsive behavior.</p>
<p>A typical web export reads the editing data and generates fresh HTML. But once the output is produced separately, the editor and the published copy become two different interpreters from that moment on. Whenever I fix the page calculation or mobile navigation on one side, I have to repeat the same change on the other, and the slightest drift makes the real link differ from the result I approved in the preview.</p>
<p>I didn't define publishing as a transformation that generates a new document. I saw it as the process of preserving, in another execution environment, the document meaning that was fixed at editing time. More important than how I split responsibilities between server and browser was the principle that the same input state must produce the same observable result in different environments. In Part 20, I'd like to lay out that principle as mathematical properties of the public document.</p>
<h2>Snapshot semantics</h2>
<p>If the document at publication time is \(\sigma_t\), the published copy must read a state fixed at a specific moment, not an editing state that keeps changing. Otherwise, only some of the values changed while the publish request was in progress get mixed in, and a document that never actually existed at any point in time can be created. A snapshot isn't just a copy; it is a consistent observation at a single logical instant.</p>
<p>If I write the render result as \(R(\sigma,e)\), then \(e\) is the execution environment, such as screen size and input method. The editor and the public page can't have exactly the same environment, so the entire pixel array doesn't need to be identical. Instead, the content, reading order, constraints and permitted interactions must have the same meaning. The first job was to separate what may vary with the environment from the invariants of the document itself.</p>
<p>A snapshot must be complete, but it needn't be redundant. Completeness means the information needed to determine the published result doesn't depend on external mutable state. By contrast, re-copying content the source already holds, or storing every value that can be derived by computation, only inflates the state space. Like a minimal sufficient statistic, I kept only the information needed to reproduce the result, and drew the boundary so that this alone can determine the observed meaning.</p>
<p>If a normalization function \(N\) satisfies \(N(N(\sigma))=N(\sigma)\), old and new states meet at the same normal form. Missing values, out-of-range values and equivalent values that differ only in representation don't produce a different result at each boot. Thanks to this idempotent normalization, a published snapshot became a stable semantic unit across changes of time and execution environment.</p>
<h2>Resource closure</h2>
<p>An ebook isn't made of the body text alone. If a document references fonts, images, styles and an internal navigation structure, the unit that can be published is not the starting file but the closure of the reference graph. If the resource graph is \(G=(V,E)\) and the root document is \(r\), the set of required resources is \(\mathrm{Reach}(r)\), the set of vertices reachable from \(r\).</p>
<p>If even one element is missing from this set, the document exists only partially. When the body opens but the fonts differ, or the cover shows but the images inside vanish, it means that a successful file transfer and a successful preservation of the document are different things. So it was more accurate to see the unit of publication as a self-contained graph defined by reachability, not as a list of individual files.</p>
<p>Conversely, if unreachable resources keep being included, the snapshot grows needlessly and stale information lingers. Computing the graph closure and excluding every vertex outside it is the same principle as mark-and-sweep in garbage collection. Starting from the root, I mark only what is needed, and resources that contribute nothing to the observed result can be removed from the published meaning.</p>
<p>Resources that aren't essential to running the body, such as a representative image, I kept in a separate optional set. With a required set \(M\) and an auxiliary set \(A\), publishability is decided by the completeness of \(M\), and a failure in \(A\) may be a drop in quality but must not become a failure of the document itself. With this distinction made clear, I got self-containedness and resilience together, without a problem with a single resource halting the whole publication.</p>
<h2>Atomic publication</h2>
<p>The state to avoid most in a publishing system is a document that readers can reach but whose content isn't fully ready. If the externally observable state is \(U\) and the ready state is \(C\), it is best for the transition to appear logically in one step, \(U\to C\). Even if several jobs are needed internally, no intermediate state should be exposed to an outside observer.</p>
<p>This requirement is broader than database atomicity. Large resources and small metadata differ in cost and failure patterns, and cramming everything into one physical transaction doesn't make the problem go away. What matters is deciding which point serves as the linearization point of the publication. Before that point the previous version must be valid, and after it the entire new version must be valid.</p>
<p>I split the failure model explicitly as well. A failure before preparation must return to a state in which nothing has been published, and a cleanup failure after commit must not roll back a publication that has already succeeded. Writing this as a state machine makes it clear which failures are compensable in the transitions among prepare \(P\), commit \(C\) and cleanup \(K\). If every error is undone in the same way, even a successful result ends up damaged.</p>
<p>Retryability comes from idempotence. If applying the same publish intent \(q\) twice satisfies \(F(F(s,q),q)=F(s,q)\), a re-request after a network drop won't create a duplicate document. I verified publishing, updating and recovery against this principle, and stabilized things so that from the outside one only ever observes either the complete previous state or the complete new state.</p>
<h2>Identity and Namespace</h2>
<p>A document's content, its identity and the name readers use are not the same thing. Content changes over time, identity ties those changes into a single document history, and the public name is the result of mapping an identity into an external namespace. If these three layers are merged, the address changes whenever the content is edited, or different documents collide just because their names happen to be the same.</p>
<p>If the identity set is \(I\) and the public name set is \(N\), name assignment can be seen as a partial function \(u:I\rightharpoonup N\). For documents that are currently public, this function must be injective. \(u(i_1)=u(i_2)\) must imply \(i_1=i_2\), so that one name never points to two documents at once. Meanwhile a new version of the same identity must keep corresponding to the same name.</p>
<p>Objects with a containment relationship, such as a project and the publications within it, also have separate identities. A name that refers to a set and a name that refers to an element of the set can't substitute for each other. From the relational viewpoint they have different candidate keys, and from the graph viewpoint they are different kinds of vertices. If a child object were assumed to be the same just because its parent object is the same, ambiguity would arise the moment multiple documents are handled.</p>
<p>I treated identity as nominal identity rather than value comparison. Documents with the same content can still be different documents, and a document whose content changed can still be the same document. After setting this standard, external names stayed steady through repeated editing and republishing, and several kinds of documents could coexist in one workspace without intruding on each other's public history.</p>
<h2>Reference monitor</h2>
<p>A public address can be known by anyone, so knowing an address must not imply the authority to change anything. If the set of principals is \(S\), the set of objects is \(O\) and the set of permissions is \(P\), the access policy can be expressed as an access matrix \(A:S\times O\to2^P\). Reading, editing, publishing and switching to private are different permissions, and there's no reason to bundle them under the same condition.</p>
<p>Every sensitive operation has to pass through a reference monitor. As in the classic conditions, the monitor must be completely mediating and non-bypassable, its own policy must not be tamperable, and it must be small and clear enough to be verified. If permission checks are scattered across many processing stages, the chance that one path misses them grows. Conversely, when a single policy boundary governs every state change, it becomes easier to prove the system's security invariants.</p>
<p>The order of checks is also part of safety. If an observable side effect occurs before the permission decision, the system state may already have changed even if the request is ultimately rejected. So a safe transition must keep the order \(precondition\Rightarrow effect\), and when a decision can't be settled, it must fall into the deny set rather than the allow set. This is the fail-closed principle.</p>
<p>Whether a document is public is a security state different from the existence of its identity. Switching to private doesn't erase the document's history, and merely existing doesn't make a document observable by everyone. If the visibility lattice is \(private\preceq public\), publishing is an upward flow of information and going private is the removal of outside observation paths. Applying this distinction, I completed the work so that the permission boundaries of publishing, unpublishing and recovery stay consistent.</p>
<h2>Relational metadata</h2>
<p>The metadata of a public document is smaller than the binary body, but it decides identity and discoverability. If I view it only as one giant record, it's hard to tell which value functionally depends on what. If a relation \(R\) has a functional dependency \(X\to Y\), then two tuples with the same determinant \(X\) must have the same \(Y\). This rule became the standard for organizing the relationships among document, user, public name and time information.</p>
<p>The purpose of normalization isn't to create lots of tables but to prevent update anomalies. When one fact is repeated in several places, a contradiction arises the moment only some of them change. Conversely, splitting values that are always read together too finely only adds join costs and points of failure. I divided facts by meaning, into facts about identity, presentation snapshots and references to large resources, so that each fact has one authoritative location.</p>
<p>Time isn't a single value either. The creation time is the start of the document's history, and the last-modified time indicates the freshness of the current version. If both are overwritten by the same rule, the document's origin changes every time it is republished. Separating immutable time from mutable time lets sorting, caching and audit records each keep their own meaning.</p>
<p>It also has to be clear what to trust when the local editing state and the public state differ. In a distributed system with several replicas, not all copies can be the authority at once. Facts that affect the outside world, like whether something is public, are decided in a single authoritative relation, and the remaining state is treated as a projection that shows that fact quickly. Thanks to this principle, the public state was restored without contradiction even after a refresh or reconnection.</p>
<h2>Observable shell</h2>
<p>A public document must carry at least minimal meaning even before all of its executable code is ready. Search engines, share previews and assistive technologies observe a document differently from a finished interactive screen. So the initial response should provide the document's external meaning, such as the title, description, representative resources and canonical address, and the execution environment that follows should add interaction progressively.</p>
<p>This can be seen as monotonic enhancement. If the initial set of observed information is \(O_0\) and the set after execution is \(O_1\), then \(O_0\subseteq O_1\) must hold. Even as features are added, the title or document identity delivered at first must not be overturned. Instead of becoming different documents depending on whether JavaScript runs, the same document offers richer operations.</p>
<p>Moving strings into several language contexts also requires per-context encoding. HTML body, attributes, URLs and script data have different permitted grammars, so a single escape function can't handle them all. Only by producing a safe representation according to the grammar of the target language the value goes into can data that crosses a boundary avoid being interpreted as structure itself. The safety of a public document is also decided by this kind of rigor at language boundaries.</p>
<p>I considered quickly observed values, such as the first screen's background and its basic geometry, to be part of the document's meaning too. Even an arbitrary screen that flashes briefly before the body is ready is a real result to the reader. I reduced the visual discontinuity between the initial and final observation, and organized the public screen so that the document's identity and access path remain even without any interaction.</p>
<h2>Behavioral equivalence</h2>
<p>Saying that the editor's preview and the public reader are the same doesn't mean the code strings are the same. If I view the two systems as labeled transition systems \(M_1=(S_1,A,\to_1)\) and \(M_2=(S_2,A,\to_2)\), then for the same user action they must move to corresponding states and be able to observe the same result. This is a question of behavioral equivalence.</p>
<p>If there is a relation \(\mathcal{B}\subseteq S_1\times S_2\) between the two sets of states such that for every transition \(s_1\xrightarrow{a}s'_1\) on one side there exists \(s_2\xrightarrow{a}s'_2\) on the other with \((s'_1,s'_2)\in\mathcal{B}\), then the two systems are in a bisimulation relation. As long as page navigation, chapter selection, changes in screen conditions and theme switching keep this relation, readers experience the same document even though the internal environments differ.</p>
<p>The public reader offers no editing operations, so the operation sets of the two transition systems can't be exactly the same. The public mode can be seen as a subalgebra that picks only the read operations from the editing transition system. What was removed is not the document's meaning but the authority to change state. The operations needed for observation and navigation have to stay closed.</p>
<p>Instead of maintaining two implementations that merely make the screen look similar, I reviewed against whether the same semantic function holds in both environments. The responsive boundaries, page ratios, chapter selection and transition results all kept their correspondence, and things were stabilized into a structure in which an improvement on one side doesn't break the meaning on the other.</p>
<h2>Deterministic boot</h2>
<p>Booting the public reader means loading several resources at the same time, but the result must not depend on the accident of execution speed. If I write the boot states as \(B_0,B_1,\ldots,B_n\), each transition may move to the next state only when its required preconditions are met. Tasks that can be prepared independently may run in parallel, but the commitment of the observable screen has to happen from one consistent state.</p>
<p>Determinism doesn't mean fixing the order of every event. It is closer to confluence: even if independent events occur in a different order, the final state must be the same. If two transitions \(a,b\) are independent, \(a(b(s))=b(a(s))\) holds, and an ordering is imposed only where there is a dependency. Keeping this property produces the same document regardless of network and device performance.</p>
<p>Screen size changes also have to distinguish continuous noise from meaningful state changes. When small changes repeat near a threshold, chattering can occur, with two modes flipping back and forth. Using hysteresis, which sets different entry and exit boundaries, or a stable interval of a certain duration is the standard control-theory remedy for this kind of instability.</p>
<p>I set the final reveal point to after the state machine has converged and the closure of the required resources is ready. At the same time, I kept a liveness condition so that a delay in some non-essential resource can't block the whole system forever. Across repeated network delays and screen transitions, I confirmed that the first chapter, the reading order and the geometry state boot to the same result.</p>
<h2>Persistent publication</h2>
<p>What matters in republishing is the persistence of the document's identity more than the creation of new files. If the versions of a document \(i\) are \(v_0,v_1,\ldots,v_n\), the public address should point to the whole family of versions rather than to one specific version. Readers see the latest valid version under the same name, and the system must be able to distinguish the temporal relationships among versions when needed.</p>
<p>This structure follows the principle of persistent identifiers. A name has to be a function of the document's identity, not of its location or its byte array. If the name changes every time the content does, external references break, and if different documents share one name, referential integrity collapses. Separating a stable name from a mutable payload preserves both edits and outside citations.</p>
<p>A cache that doesn't know this time model can keep showing stale observed values. Including the logical version \(v\) in the observation key keeps the same identity while distinguishing the new state from the old one. What matters isn't eliminating caches outright but making clear the equivalence relation for when two representations can be treated as the same value.</p>
<p>I repeatedly reviewed flowing EPUBs and fixed-layout documents, new publications and updates to the same address, failures of required and optional resources, mobile and desktop, switching between public and private, permission denials, normalization of old snapshots and cache refresh. I confirmed that the content, reading order, layout constraints and interactions of the editor and the public page keep the same meaning. The Publisher system, which publishes an edited book as a web document without conversion loss, was fully implemented and stabilized.</p>]]></description>
      <category>dev</category>
      <pubDate>Sat, 18 Jul 2026 11:53:10 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: An InDesign-Style Layout Editor</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-13?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-13?lang=en</guid>
      <description><![CDATA[<p>Once I had built the vector editor and the Rust graphics engine behind it, the next tool I needed was naturally settled. I could now make the images and shapes that go into a book myself, but placing them on actual pages was an entirely different kind of editing. If a graphics editor handles objects on a single plane, a layout editor has to understand multiple pages and spreads, bleed, margins, master pages and print specifications all at once.</p>
<p>From the start, I did not think of this editor as a vector canvas with page borders added. In a real book, an object with the same coordinates becomes a completely different thing depending on which page it belongs to, and left and right pages have different margins relative to the spine. A photo must be able to span the whole spread across the spine, and common headers and page numbers must be managed in a master rather than on individual pages.</p>
<p>That said, I had no intention of simply replicating the rules of the paper book either. Opkle's layout would later have to go back out as EPUB and the web, so it had to hold free coordinates and flow-based structure together. First, I decided to build the page space, the floor beneath all this work, exactly right. In order, I worked out how to describe the ownership of a scene, which physical unit to compute in, and whether an action on screen remains a document coordinate independent of zoom.</p>
<h2>The Gap After Vector</h2>
<p>The center of a vector editor is the object. Rectangles, ellipses, paths, text, images and groups move on one coordinate system, and selection and transforms follow those objects. In a layout editor, one more ownership region, the page, rises above this scene graph. Even the same shape has a different local origin, clip and template context depending on which page it is a child of. A page is not a border on screen but a scene node that defines coordinates and ownership together.</p>
<p>In designing the document model, I first separated semantic state from display state. Values that make up the document's meaning, such as trim size, page order and styles, must be independent of zoom or the current selection. Conversely, pan, selection boxes, resize handles and hover indicators are view state, a brief way of looking at the same document. If the two are mixed, you get problems like the saved result changing because the screen was zoomed, or guides ending up in the printout. The separation of Model and View went beyond a UI pattern and became a device for protecting document invariants.</p>
<p>I treated order and identity as different concepts as well. An array index is good for fast traversal, but the moment an item is inserted in front, everything behind gets a different number. A stable identifier keeps pointing at the same object even when its position changes, and order is expressed as a separate relationship. This principle is the same as separating a primary key from a sort column in a database, and in a scene graph it is the basis for keeping selection, history and referential integrity intact.</p>
<p>I defined editing operations to target a single local coordinate space wherever possible. Translation is vector addition, and rotation and scaling are affine transforms, and these operations themselves need not know whether the target is on the first page or the hundredth. If you can move between local and world through the parent page transform, the same geometric operations can be reused in every ownership region. What scaled up the multi-page editor was not duplicating features but making the coordinate context explicit.</p>
<h2>Physical unit</h2>
<p>In a layout editor, I had to sort out the coordinate units again from scratch. The CSS pixel familiar on screen, the point used in print specifications, and the millimeter a user types when entering trim size and margins are not the same number. I decided to keep document specifications and output coordinates in the point family, and to convert trim size and margin inputs shown to users into millimeters. Since PDF and IDML work mainly in point space, it was more accurate to align the internal standard with that.</p>
<p>I set the canonical unit of conversion to the inch. <code>1 inch = 25.4 mm</code>, <code>1 inch = 72 pt</code>, and the CSS pixel is converted on the basis of 96 DPI by default. Any length is first normalized to an inch ratio and then returned in the target unit. Instead of scattering different conversion constants among mm and pt, and px and pt, I made them share a single unit path, so the input fields, document defaults, presets, SVG coordinates and PDF output all use the same values.</p>
<p>I did not store A4 as a rounded value like <code>595 × 842</code> either. I used the exact point conversion of <code>210 × 297 mm</code> as the default, so that displaying it again in mm brings back a clean 210 and 297. A small rounding difference is not noticeable on one page, but it can accumulate when page boxes, bleed and print marks are repeatedly computed. Trim size presets, new documents, reset and the fallback for past projects were all aligned to use the same reference values.</p>
<p>When print resolution is needed, I separated document coordinates from raster coordinates again. First you find the physical length that 1 unit on the page represents, then decide the pixel count from the output DPI. The zoom of the editing screen is only the magnification the user sees and does not affect the actual size of the document. Since I fixed this principle, screen zoom, PDF output and high-resolution image output no longer produce different sizes.</p>
<h2>Three Coordinate Spaces</h2>
<p>With units sorted out, I separated the coordinate spaces next. The value a mouse event gives is in the browser's client coordinates, and the SVG stage uses viewport coordinates with pan and zoom applied. Actual objects are stored in page local coordinates, which take each page's top left as <code>(0, 0)</code>. The same point has different numbers on screen, on the canvas and on the page.</p>
<p>Subtract the stage's translation from the screen point <code>p_screen</code> and divide by zoom to get the world coordinate. Subtract the translation of the target page group from that and you get page local coordinates. In a formula, <code>p_local = (p_screen - t_view) / zoom - t_page</code>. The master editing space uses a separate page translation, so I chose the last transform matrix depending on the current mode and the page being edited.</p>
<p>I applied this transform to every insertion path, beyond simple pointer computation. When a user drops an image onto another page, I first compute the intersection of the screen point with each page rect to find the target page, activate that page, and then convert to a local point. When moving an object to the other side of a spread, too, I lift the starting page's coordinates to root coordinates and then bring them down to the destination page's local coordinates. If you just add the x difference directly in between, the position drifts the moment zoom or the spread gap changes.</p>
<p>Selection regions and resize handles followed the same principle. The object geometry stays in page local coordinates, and only the selection overlay is drawn on the root layer. So even if you select several objects together or move to a page with a different page translation, the actual stored coordinates stay uncontaminated. Separating the coordinates that look right on screen from the coordinates that are stored right in the document became the reference point for multi-page editing.</p>
<h2>The Geometry of Spreads</h2>
<p>For page placement, I computed single pages and spreads with different rules. With single pages you just line up the pages vertically, but in a spread the first page sits alone on the right, and from the next page on, left and right pages form pairs. I decide each side by page parity and move to the next spread row each time a pair is complete. When adding or deleting pages changes the parity, the margins and masters of the following pages are recomputed.</p>
<p>With bleed, you cannot simply space pages apart by the page width. The two bleed areas on the spine side might look overlapped, or an unnecessary gap might appear, so the spread gap accounts for both sides' bleed and the actual working gap. The page background, bleed guides, margin guides and trim boundaries are separated into dedicated layers below the body objects. This arrangement ensures that, even when the active page is raised to the front, its white background does not cover the spread image of the neighboring page.</p>
<p>I made the clip asymmetric as well, for objects that cross the spine. If every page gets a clip of its own width, a photo that starts on the left page is cut off the moment it passes over to the right. For facing pages, I extended the clip region only in the spine direction to the neighboring page, while the outer sides and top and bottom keep being clipped by the page box. The object keeps its membership in one page, yet in the actual spread it looks naturally continuous.</p>
<p>Margins carry the meaning of inside and outside before left and right. On a right-hand odd page, inside is physically the left, and on a left-hand even page, inside is the right. When applying document settings, I convert logical margins into physical margins matching the page parity and reflect them in the body guides and automatic text frames. Asymmetric binding margins and left/right masters flip correctly according to page order.</p>
<h2>Smart guide</h2>
<p>In layout work, the feel of moving things by hand to exact numbers mattered. When you drag an object, it should snap naturally to the page center and edges, margin lines, and the centers and edges of other objects. Rects, ellipses, images, foreignObjects, paths and groups store geometry differently, so I first normalized the actual bounds into a common form <code>(x, y, w, h)</code>.</p>
<p>I made the left, center and right and the top, middle and bottom of the selection into snap axes, and collected the same axes of the page and surrounding objects as candidates. I compared the delta to each candidate and applied to the movement only the nearest value within the threshold. So that the snap distance felt on screen does not vary too much as zoom grows, the threshold is converted between document coordinates and screen coordinates according to the current magnification.</p>
<p>With a single threshold, an object would keep snapping and unsnapping at the boundary. So I remember the mouse position where the snap began and the delta applied, and added hysteresis with a release threshold wider than the entry threshold. The earlier decision is kept until the user clearly leaves the snap axis, so the object does not jitter even when moved slowly. The x and y axes can be locked independently, so you can keep one-sided alignment while continuing to move in the other direction.</p>
<p>Equal-spacing snap is computed as a separate candidate group. I compare the gaps <code>g_left</code> and <code>g_right</code> between the selected object and its left and right neighbors, and find the movement that makes the two equal. For the vertical axis I compute the gaps above and below in the same way. On an axis where regular alignment already applies, I gave priority so that the equal-spacing judgment does not intervene, and the actual gap is shown with dimension lines and number badges. The guides are computed in page local space but drawn on the root overlay so that they follow accurately even during pan and zoom.</p>
<p>For the ruler too, I derive the world range the current viewport is looking at, in reverse, to build the ticks. Major and minor tick spacing changes with zoom, and ticks outside the screen are not generated. Re-reading the stage's layout values at every pointermove incurs the cost of forced reflow, so I cached the bounding rect and transform values and invalidated them only on pan, zoom and resize. The smoothness of manipulation was, in the end, the result of managing coordinate computation and browser layout cost together.</p>
<h2>Object hierarchy</h2>
<p>Objects within a page do not all sit at the same depth. A group that bundles several elements must move as a single transform target, but when needed you should be able to select and edit the inner elements again. In normal selection mode a group is treated as a single object, and double-clicking enters an isolation state that edits only that group.</p>
<p>In the isolated state, I limited the root of selection traversal to the current group rather than the whole page layer. Even if elements outside the group overlap under the mouse, they are not promoted to selection candidates, and only the group's direct children are selected. When you create a new shape or text, it is inserted into the isolated group rather than the current page. Tab traversal and marquee selection use the same root, so the isolation on screen matches the actual DOM ownership.</p>
<p>The current editing scope is shown with a dashed outline, but since this overlay is not document data, I separated it as a transient element. It is excluded before the save string and history snapshot are made, and when zoom changes, the stroke and dash spacing are readjusted. Clicking the outer background or switching pages ends isolation and selects the group itself again. Even if the group is deleted or detached from the DOM during editing, the state is cleaned up automatically so that no dead references remain in the selection.</p>
<p>I placed the page background and guides, the master DOM, individual objects and the selection overlay in separate layers for the same reason. Distinguishing layers that are saved from layers that exist only on screen prevented resize handles from lingering in undo or guides from mixing into the printout. A layout editor's page was completed not as a single SVG sheet but as a combination of several layers that distinguish ownership and editing lifetime.</p>
<h2>Master page</h2>
<p>You cannot manage elements that repeat across a whole book by copying them onto every page. Headers and footers, ornamental rules, backgrounds and page numbers are a template problem. If an ordinary page owns the template's result as actual children, fixing one common element means editing every page again, and it becomes unclear which value is the original. So I viewed repeated elements as a prototype relationship that distinguishes a definition from its instances.</p>
<p>A template is closer to a function that takes a context than to a fixed picture. Values like the page number, the total page count and left or right side become actual display values only when <code>T(context)</code> is evaluated. The same definition can produce a different result for each page, and when page order changes, you do not fix the original; you just re-evaluate in the new context. It is as if the strengths of declarative UI and functional templates were applied directly to publishing pages.</p>
<p>Inheritance needed priorities. Template values sit on top of document defaults, and a property that an individual page explicitly changed wins in the nearer scope. If you copy every property unconditionally, you can no longer tell overrides from the original when the original changes, so it is better for a page to remember only the values it actually overrode. Like the CSS cascade, knowing the origin and specificity is what lets repeated elements and individual edits coexist.</p>
<p>I separated the editing scope logically as well. When editing an ordinary page, the template's result is visible but cannot be selected directly, and the common definition can be edited only after entering the template context. Being drawn on the same screen does not make things objects of the same lifetime. By distinguishing render order, selectability and storage ownership separately, I kept the repeated structure from mixing with the body objects.</p>
<h2>The Page Engine Takes Shape</h2>
<p>The first milestone of the layout editor was not the number of tools. What came first was that semantic state and view state are separated, that an object's identity holds even when the order changes, and that physical units round-trip exactly regardless of screen magnification. Only when the transforms among local, world and screen coordinates can be explained within a single matrix system can the later text typesetting and document conversion work trusting the same positions.</p>
<p>On top of that, I built spreads where the first page sits on the right, asymmetric clips toward the spine, mirrored inside and outside margins, and the containment relationships of bleed and page boxes. I normalized different shapes into a common bounds model to make alignment and equal-spacing snap, and group isolation and transient overlays made it safe to edit even complex scene graphs. Repeated elements were separated from the body with template functions and inheritance priority.</p>
<p>I verified the coordinate invariants by repeating page reordering, switching between single pages and spreads, asymmetric margins, different bleeds, high and low magnification, moving objects between pages, editing nested groups and applying templates. I confirmed that a position that was right on screen is restored to the same physical coordinates when reopened and also matches the output page box. The page engine that can assemble vector assets onto the surface of a real book was stabilized to a polished state at this stage.</p>]]></description>
      <category>dev</category>
      <pubDate>Sat, 18 Jul 2026 00:54:08 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: Text That Flows Across Pages</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-14?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-14?lang=en</guid>
      <description><![CDATA[<p>With the page space finished, the next character of the layout editor became clear. Placing shapes and images at exact positions is not enough to edit a book. A manuscript changes in length, and every time the font, leading or trim size changes, the boundaries of lines, paragraphs and pages move together. Typesetting was not a matter of computing coordinates once; it was the problem of continually re-solving for a layout that satisfies many constraints.</p>
<p>Browsers have flow-based layout engines too, but the objective function of publishing typesetting is a little different. A screen can extend downward without limit to fit the available width, while a book is divided into a finite sequence of page boxes. Depending on where to cut a paragraph, how far to avoid orphan and widow lines, and whether to keep a figure and its caption on the same page, several possible solutions arise. A simple overflow check alone could not define good typesetting.</p>
<p>I saw this problem as a composition system more than as a feature for moving text between boxes. Free coordinates and flow-based structure, paragraph meaning and physical pages all meet in one constraint system. Even with the same input string, the solution changes if the font metrics and widths change, and under the same conditions the result must be identical no matter when it is computed. At this stage I reorganized typesetting in the language of graphs, optimization and fixed-point computation.</p>
<h2>Formatting context</h2>
<p>A book's page is not made up of absolute coordinates alone. There are areas where an image and its description sit side by side, where several items follow one another at regular intervals, or where items must wrap to the next line when the width shrinks. Such arrangements are described more accurately by a formatting context than by a list of coordinates. The container sets the main axis and cross axis, and each child submits its minimum size, preferred size and capacity to grow as constraints.</p>
<p>Let the available length be A, a child's base length <code>b_i</code>, its grow factor <code>g_i</code> and its shrink factor <code>s_i</code>; layout is then the problem of distributing the difference between <code>Σb_i</code> and A among the children. With slack, you divide it by the grow ratios; with a shortage, you reduce considering the shrink factors and base sizes together. However, once an item appears that cannot go below its minimum content size, the remaining items must be recomputed, so it is closer to an active-set problem than to a single proportional formula.</p>
<p>When wrapping is allowed, the problem changes from 1D distribution to interval partitioning. Keeping the children's order, you decide at which point to start the next line, and recompute the leftover space and alignment for each line. The number of possible partitions grows quickly with the number of items, but in a real editor a local greedy solution with minimum-size constraints alone can produce predictable results. What mattered was distinguishing computed results from the constraints the user specified.</p>
<p>From this viewpoint, flow inside a fixed page was not a special exception either. Free coordinates are strong constraints that determine position directly, and flow containers are weak constraints that determine position through relationships. Both are ultimately expressed as transforms and size constraints in the scene graph. Even though the tools look different, the internal math settled into a combination of variables, constraints and computed solutions.</p>
<h2>Constraint space</h2>
<p>The difference between free placement and flow placement lies less in the kind of object than in who decides the coordinates. In free placement, <code>(x, y, w, h)</code> are close to independent variables, while in flow placement, once order, minimum sizes and alignment rules are given, the coordinates become computed results. Moving from one representation to the other is not changing the DOM but swapping the roles of independent and dependent variables.</p>
<p>Inferring structure from a free-placement result is essentially an inverse problem. The same screen can be explained by several structures. Two elements sitting side by side might be one row, or two independent objects that happen to share the same y coordinate. Since the original intent cannot be uniquely recovered from observed geometry alone, criteria like minimum description length and stability are needed. A structure that explains the current layout with few rules while preserving relationships even when the screen width changes makes the better candidate.</p>
<p>Conversely, fixing a flow structure into free coordinates is forward evaluation. You evaluate the constraint system once and convert the resulting box geometry into coordinates in document space. Here, screen zoom and viewport movement are merely observation transforms, so they must be removed by the inverse matrix. The resulting coordinates must belong to the reference space defined by the document, not to the screen the user was looking at.</p>
<p>This round trip is not a perfect inverse. The moment you fix things to free coordinates, information such as wrapping possibilities and relative alignment can vanish, and when you infer the structure again, the same solution is not guaranteed. So I looked at the conversion from the standpoint of information preservation, and clearly distinguished the degrees of freedom lost from the constraints newly created. The relationship between paper typesetting and responsive documents could also be understood as a combination of the same inverse problem and forward computation.</p>
<h2>Story graph</h2>
<p>Body typesetting started from the relationship between the manuscript's logical order and the physical regions that hold it. A manuscript is one linear sequence, but a page is divided into several boxes. Viewed as a graph, text segments are ordered vertices, frames are compartments with capacity, and typesetting is a function that maps segments to compartments while preserving order. Even when the pages on screen are split, the topological order of the manuscript must not break.</p>
<p>The key invariants needed in the graph are connectedness and acyclicity. If a single story branches or has a cycle, the next sentence can split into two places or circle endlessly through the same frame. So a valid flow is closer to a path graph than a general graph, and strong restrictions apply to the in-degree and out-degree of each vertex. This condition is not about a particular storage method; it is a mathematical property of the typesetting model itself.</p>
<p>When frames are added or removed by editing, what must be preserved is the manuscript sequence rather than the objects on screen. Before and after a graph transformation, the relative order of all characters and paragraphs must be the same, and no segment may be duplicated or lost. This can be seen as multiset preservation and an order-preserving mapping. As structural changes grow larger, verifying this global invariant is stronger than checking individual pointers.</p>
<p>In a partially observed graph, global typesetting cannot be fixed. This is similar to how a distributed system cannot judge the whole state from an incomplete view. If the needed segments are not ready, it is safer to defer the computation and evaluate the same story once, when the complete boundary conditions are in place. Reducing computation in large documents was also, in the end, the problem of finding which part of the graph affects the current solution.</p>
<h2>Line breaking</h2>
<p>Line breaking was not a matter of filling characters to the width and cutting when they overflow. The real input is closer to a glyph sequence than to characters. After ligatures, kerning, Hangul composition and script shaping, the number of characters and the number of displayed glyphs differ, and a line's width is determined by the sum of each glyph's advance and the adjustable spaces. I first had to distinguish linguistic boundaries from the break opportunities available for typesetting.</p>
<p>The quality of one line can be evaluated by a single quantity, the leftover space. If the target width is W, the line's natural width N, the stretchable space S and the shrinkable amount R, the adjustment ratio is <code>(W-N)/S</code> or <code>(W-N)/R</code> depending on the sign of the leftover. If this ratio is too large the spaces open up, and if it is too small the letters feel cramped. If you set badness as something like the cube of the ratio, you can tell several slightly bad lines apart from one very bad line.</p>
<p>Line breaking for a whole paragraph turns into a shortest-path problem on a DAG whose vertices are the possible break points. If the stretch between two break points can be a line, you create an edge and set that line's badness and hyphen penalty as its cost. If you find the path with the smallest total cost by dynamic programming, the paragraph's overall gray value comes out more even than with a greedy method that only fits the last line. The reason Knuth-Plass style typesetting is strong is that it optimizes the whole paragraph, not a single line.</p>
<p>At page boundaries the cost function grows further. Separate penalties are needed when only the first or last line of a paragraph is left on another page, when a heading is split from its body, or when a footnote appears before its reference. Typesetting becomes an optimization with many semantic constraints, not string splitting. Results were reproducible only after even the tie-break rules were decided, so that the same input and metrics select the same minimum-cost solution.</p>
<h2>Layout fixed point</h2>
<p>Typesetting looks like a process of content being pushed out in one direction, but mathematically it is closer to an iterative computation that seeks a stable state. If the current layout is <code>x_n</code> and the typesetting operation is F, the next state is <code>x_(n+1) = F(x_n)</code>. The <code>x* = F(x*)</code> at which line and page boundaries no longer change is the fixed point. Even when text grows or shrinks, repeating the same operation must converge to a new stable point.</p>
<p>To guarantee convergence, state changes need monotonicity. If content sent backward to reduce overflow comes back forward by some arbitrary rule within the same pass, oscillation can occur. You can fix the direction and priority of computation and put in a potential function so that the amount of violation each step tries to resolve decreases. For example, you check whether a weighted sum of every frame's excess height and its empty space toward the front decreases at each iteration.</p>
<p>But if a font changes late, or an image size is settled asynchronously, the function F itself changes mid-computation. Convergence cannot be discussed for a moving objective, so you first have to fix a single layout epoch in which metrics and assets are ready. Within one epoch, inputs and constraints are held immutable, and when new information arrives, instead of modifying the earlier computation you re-evaluate in a new epoch.</p>
<p>For the termination condition as well, it is better to use a meaningful state difference rather than a simple iteration count. If the per-page break points and the overset set have become the same, the typesetting result can be considered stable even if small floating-point errors remain in the geometry. Conversely, if the break points swing back and forth between two states, you detect the cycle and fall back to safer constraints. A deterministic solution in finite time mattered more to an editor than a theoretically perfect one.</p>
<h2>Fragmentation context</h2>
<p>The latter part of a paragraph that crosses a frame is not a new paragraph. In the logical tree it is one block, but in physical typesetting it appears as several fragments. Here you have to distinguish properties that apply only to the start of the paragraph, such as margin, first-line indent and drop cap, from backgrounds and borders that must repeat on each fragment. A fragmentation context starts by abandoning the assumption that logical objects and physical pieces are one to one.</p>
<p>Seen as a function, a single box B is decomposed by the page constraint P into <code>F_P(B) = {b_1, b_2, ..., b_k}</code>. Joining the contents of the pieces in order must give back the original B, and the inner intervals of the pieces must not overlap. In other words, fragmentation is an order-preserving partition. When the page width changes, you must apply the new P to the original B rather than re-cutting the old pieces, so that idempotence is maintained.</p>
<p>Styles have different fragmentation laws per property as well. First-line style applies only to the first line box of the first piece, space before the paragraph belongs to the first piece, and space after belongs to the last piece. Line-height and font, on the other hand, are inherited by all pieces. Rather than scattering these rules as individual exceptions, it is more general to classify which repetition meaning a property has: <code>first</code>, <code>last</code>, <code>each</code> or <code>slice</code>.</p>
<p>Widows and orphans are global constraints on this partition. If you simply choose the maximum number of lines that fit on the current page, only one line may be left on the next. If you move the break point earlier to satisfy a minimum starting-line count and a minimum ending-line count, the current page gets some empty space but the paragraph's reading rhythm improves. The correctness of typesetting lay in correctly preserving the logical structure in the physical pieces, more than in filling space to the end.</p>
<h2>Composition state</h2>
<p>Text being typeset does not exist only in a completed document state. Korean, Japanese and Chinese input methods in particular have an intermediate state that composes several keystrokes into one committed string. This state is not yet fully committed to the document but must be visible on screen. The editor had to treat committed text and composing text as states with different lifetimes.</p>
<p>Viewing the input process as a state machine gives the transitions <code>idle -&gt; composing -&gt; committed</code>. During composing, the browser and the input method jointly manage the temporary string and selection range, so if an external typesetter rebuilds the tree, ownership of the transition breaks. A safe principle regardless of language is to restrict structural changes in the intermediate state and reflect them in the logical document after the commit event arrives.</p>
<p>The caret, too, is more accurately seen as a position on the manuscript sequence than as the address of a DOM node. The on-screen tree can disappear and reappear with typesetting, but a logical position can be expressed as a boundary counted from the document start, or as a position between adjacent stable tokens. Even if the trees before and after re-typesetting differ, finding the same logical boundary again in the new fragment keeps the editing feel continuous. It is similar to how a syntax editor distinguishes source offsets from syntax nodes.</p>
<p>From a concurrency viewpoint, input and layout are different transactions. If layout reads an intermediate value as the authoritative manuscript while the input transaction is not yet committed, the same event can be applied twice or a composing string can be split. I defined the input's commit boundary first and made typesetting read only the last committed revision. Editing stability and the accuracy of the final typesetting were maintained together through this revision boundary.</p>
<h2>Pagination optimization</h2>
<p>Pagination was a partition problem at a larger unit than line breaking. You list paragraphs, figures and tables in order and divide them into intervals so that none exceeds each page's capacity. Unlike simple bin packing, the order of items cannot be changed, some items are splittable, and there are relationships like a heading that must stay with the next paragraph. It was an ordered capacitated partition with semantic penalties attached.</p>
<p>If you put the possible page breaks as vertices, it can again be seen as a DAG shortest path. If the interval <code>(i, j)</code> fits on one page, you create an edge, and assign costs to the square of the leftover margin, widows and orphans, keep-with-next violations and forced splits. Choosing the path with the smallest total cost lets you lay out even the later pages evenly, more than a greedy solution that fills the current page as full as possible.</p>
<p>Once floats and footnotes come in, the constraints become interdependent. Which page the body goes on determines the footnote height, and the footnote height in turn reduces the body's capacity. In this case you alternately compute the body layout and the height of the auxiliary regions to find a fixed point, or, if it does not converge within a set number of iterations, choose a more conservative break. A deterministic and explainable solution mattered more to an editor than an optimal solution for every case.</p>
<p>Adding and removing pages is a by-product of this optimization result. Even if a single user input changes several page breaks, it should be seen as one document transformation semantically. If the difference between the input revision and the new partition is handled as one command, rather than as individual DOM changes in the typesetting result, the manuscript and the structure can keep the same time axis in undo as well.</p>
<h2>Serializable history</h2>
<p>The history of a multi-page editor had to be the logical time of the whole document, not a per-screen stack. A single command can change several pages and assets at once, so if you revert only part of the state, nonexistent references or different revisions get mixed. Like a database transaction, all the writes of one action must be seen together or not at all.</p>
<p>There are two extremes for representing history: snapshots and operation logs. Snapshots make restoration simple but use a lot of space in large documents, and operations are small but an inverse operation does not always exist. Even a reversible command like rotation cannot guarantee the original bytes by simply applying the same operation in reverse once external asset replacement or automatic typesetting is involved. In a real system a hybrid that mixes semantic commands with snapshots of the needed scope is the natural choice.</p>
<p>Serializability is needed for multiple asynchronous tasks as well. If user input A, automatic typesetting B and saving C overlap and the final state is not equal to any sequential execution, the history and the persisted state diverge. Based on revisions, you check the state each task read and the state it wants to write, and a result that started from an old revision must not overwrite a newer state. This was the same problem as optimistic concurrency control.</p>
<p>The purpose of autosave is not to record every intermediate screen but to make the last committed revision durable. If a new revision appears during a save, it is easier to guarantee ordering by finalizing the latest revision again after the previous write finishes, rather than racing two saves. By making explicit how the history head relates to the saved revision, undo, redo and restore after restart all came into a single time model.</p>
<h2>Working set</h2>
<p>Once pages grow to hundreds, loading every scene, font and image into memory at the same time is no longer sustainable. The concept needed here was separating the whole document from the current working set. It is enough to keep in the fast tier only the pages the user is viewing or is likely to view soon, the pages that affect the story being edited, and the state referenced by recent history.</p>
<p>The working set is wider than a simple set of rectangles intersecting the screen. The neighbors of the current page are likely to be visited soon, and the segments before and after linked text are needed for re-typesetting. Conversely, even if they are visible, there is no need to keep the detailed DOM of dozens of pages shrunk very small. Using spatial distance, temporal locality and semantic dependency together makes the cache policy match the editing feel.</p>
<p>Eviction is not an act of freeing memory but one that is possible only after proof that the authoritative state safely exists in another tier. Dirty state, values being computed and values referenced by undo must be pinned, and items that are costly to reconstruct are worth keeping longer than plain LRU would. A cost-weighted cache takes into account item size, regeneration time and access probability together.</p>
<p>Full output and global re-typesetting are separate computations to which working-set optimization does not apply. All semantic state is needed then, but not all the UI for editing. If you separate reading the document model from building all the on-screen objects, even the full computation can stream within a memory ceiling. The performance of large documents depended less on one fast function than on which state gets materialized and when.</p>
<h2>The Typesetting Engine Is Done</h2>
<p>At this stage the layout editor went beyond a tool for placing text boxes on a page. I viewed free coordinates and formatting contexts as one constraint system, organized manuscript order as an acyclic story graph, and framed line breaking and pagination as shortest-path problems with penalties. I kept the invariant that a paragraph is logically one, even when it becomes several fragments on physical pages.</p>
<p>Typesetting converges to the fixed point of an iterative operation, and the input method's composition state and caret are tied to the logical document revision, not the physical DOM. I treated history and autosave as serializable transactions, and for large documents I materialized only the working set reflecting spatial, temporal and semantic locality. Features that had looked unrelated became one system within graph theory, optimization, transactions and cache theory.</p>
<p>I repeatedly checked it with combinations of short paragraphs and very long ones, multiple writing systems, extreme font metrics, orphan and widow lines, trim size changes and large documents. I confirmed that the same input and constraints produce the same break points, and that the manuscript's order and paragraph meaning hold through revision switches, saves and memory pressure. A typesetting engine that keeps its logical structure as the manuscript crosses pages was fully implemented and stabilized at this stage.</p>]]></description>
      <category>dev</category>
      <pubDate>Sat, 18 Jul 2026 00:54:08 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: EPUB and IDML as Editable Pages</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-15?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-15?lang=en</guid>
      <description><![CDATA[<p>With the layout and typesetting engines finished, there was no reason to leave this editor as a tool that only starts from a blank document. Real publishing work keeps bringing in finished manuscripts, existing EPUBs and pages made in other typesetting programs. Displaying a file and recovering an editable semantic structure were different problems. Importing was closer to translation than to rendering.</p>
<p>Each format describes a document in a different language. EPUB builds meaning around flow and the cascade, while fixed-layout documents describe a scene through pages, transforms and reference graphs. For a plain manuscript, the order and role of paragraphs matter more than pages. Turning all of these into one flat string simplifies the grammar, but the types and relationships the source language carried disappear.</p>
<p>So I viewed the import process as a compiler pipeline. You parse each format's surface syntax, resolve names and references, lower to a common intermediate representation, and finally materialize into an editable scene graph. If the parser reads the file, semantic analysis decides what that file means. An importer stopped being a feature that opens a file extension and became a meaning-preserving translation between different document languages.</p>
<h2>Document compiler</h2>
<p>The compiler's first step was not trusting the input but determining which grammar it can be read with. The file extension is only a hint; the structure of the actual bytes, the required headers and the internal relationships decide the grammar. If the structure does not hold at lexical validation, it is not passed on to the later semantic phase. A document importer, like any compiler, had to reject bad input at as early a stage as possible.</p>
<p>Even when parsing finished, I did not build editing objects right away. A syntax tree preserves the source file's representation well, but it is too format-dependent for an editor. Conversely, if you lower it directly to on-screen objects, you easily lose the names, style origins and reading order that were in the source. So I put in an intermediate representation that expresses paragraphs, assets, pages, transforms and references, and normalized the differences between formats on top of it.</p>
<p>The intermediate representation needed source provenance as well. Even for the same text, the meaning of later conversion differs depending on whether it was a heading in the source or simply large type. By not treating information interpreted with certainty and information inferred heuristically as the same value, and distinguishing confidence and origin, only the uncertain structure can be flattened conservatively. The converter had to preserve the meaning it knew rather than invent what it did not know.</p>
<p>The final materialization is the step that turns the intermediate representation into objects of the current editing model. By then, coordinate units, style inheritance and asset references must all be resolved. So that the whole manuscript is not lost even if some nodes fail along the way, I set up fallbacks at each semantic layer. I applied the compiler's error-recovery principle so that even for input whose structure could not be perfectly restored, the most important information, the text and its reading order, remains.</p>
<h2>Package graph</h2>
<p>A package like EPUB is closer to a reference graph than to a set of files. Assets are vertices, and links inside documents, stylesheets and the reading order are edges. The physical order of entries inside the archive has nothing to do with the semantic order of the graph. What the importer had to recover was not a directory listing but the document graph reachable from the root and the linear reading order the author defined.</p>
<p>Resolving relative paths was a graph normalization problem. If <code>a/../b</code>, <code>./b</code> and <code>b</code> point to the same target, different strings must be sent to the same canonical vertex. Otherwise you cannot tell asset duplication from references that do not exist. Canonicalization is not simple string cleanup but also a security boundary, so paths that escape the root and ambiguous forms must be restricted together.</p>
<p>Documents with namespaces must be read by expanded name rather than by prefix string. A prefix can differ from document to document, but the pair of namespace URI and local name carries the same meaning. It is like how, in a programming language, the result of symbol resolution matters more than a variable's surface name. This is why XML is handled as a namespace-aware tree rather than read by string search.</p>
<p>I checked referential integrity the way a compiler's link stage does. I separate out whether the target of every required edge exists, whether the media type is compatible with the actual asset's role, and which orphan assets are unreachable from the root. Rather than inventing missing targets, I judged the severity of the error and distinguished references essential to the body from auxiliary metadata. “Linking the document graph” was a more accurate phrase than “unpacking the package.”</p>
<h2>Cascade algebra</h2>
<p>The CSS cascade was not string merging but an algebra with priorities. When several declarations reach one property, the winner is decided by comparing a tuple made of origin, importance, layer, specificity and source order. This comparison is nearly a lexicographic order, and can be seen as an operation that selects the maximum element among the candidates arriving at the same element and property.</p>
<p>Inheritance is a separate stage from the cascade. Only when a value is not settled in the element's own candidate set is the parent's computed value passed down, and some properties return to their initial value. Once <code>inherit</code>, <code>initial</code>, <code>unset</code> and relative units come in, you have to distinguish the specified value, the computed value and the used value. That is why storing only the last number that appeared on screen loses which rule it came from.</p>
<p>Selector matching is predicate evaluation over a tree. A simple selector looks only at one vertex's attributes, but descendant and sibling combinators also look at surrounding relationships. If you cut the source tree into fragments, the domain of the predicate changes, and a selector that was true before can become false. Preserving styles was less about copying declarations than about how to keep the context in which the selectors were evaluated.</p>
<p>A media query can be seen as a boolean function over an environment vector. If you take viewport, orientation and color preference as variables, each query defines a subset of the environment space. Where several queries overlap, the cascade applies again. To reproduce a particular environment, the importer had to state one environment vector explicitly and evaluate every condition with the same logical expression, rather than using an arbitrary screen width.</p>
<h2>Fragmentation geometry</h2>
<p>Dividing a flow document into pages was the problem of mapping a continuous block flow onto finite fragmentation containers. Each block has splittable intervals and unsplittable atomic regions, and margin collapse, floats and keep constraints change the possibilities for the next break. A single bounding box cannot express the actual pieces of an element spanning several pages.</p>
<p>Typesetting geometry has meaning only after the font metrics are settled. Even the same string gets different advances depending on glyph substitution, kerning and fallback, and line breaks shift in a chain. So the font set is not an external extra of the layout function but an input variable. When the input fonts differ, even the same DOM has gone into a different function, so the previous geometry cannot be reused.</p>
<p>Looking at fragmentation as an interval algebra, one logical box turns into an ordered sequence of rectangular pieces, one per page. Each piece maps a source content interval <code>[a_i, b_i)</code> to a physical region <code>R_i</code>, and the intervals must not overlap and must add up to the original range. With this provenance, even when you select a piece on screen you can explain which part of the source document it is.</p>
<p>I separated measurement space from display space as well. Typesetting is computed in canonical coordinates with no zoom or pan, and the screen applies an observation transform to the result. If the display magnification got mixed into the layout input, you would get the contradiction of line breaks changing when you zoom. The foundation of page import was not DOM techniques but a stable mapping between logical intervals and physical pieces.</p>
<h2>Provenance tree</h2>
<p>When the source tree is divided into physical pieces, the ancestor context can vanish. Descendant selectors, relative units and inherited values depend not on the current node alone but on the path leading up to the root. So a fragment had to be not an independent document copying only the leaves needed on screen but a view looking at a particular interval of the source tree. Provenance explains which logical node and path a piece came from.</p>
<p>This relationship can be thought of like a path in a persistent tree. The source tree remains the authoritative structure, and each fragment describes itself through the source revision, the node path and the content interval. Since you can compute new pieces from the source at any time rather than guessing the source by joining pieces, information is not lost cumulatively even when the trim size changes.</p>
<p>Preserving styles needs two representations. The source rule explains why a value was applied, and the computed value explains what it actually became in the current environment. If you keep only the former, selectors can change in a fragment cut off from context, and if you keep only the latter, the user cannot edit the original style. Preserving cause and effect together was similar to handling a compiler's source map together with the optimized code.</p>
<p>I distinguished a glyph's ink bounds from the line box as well. The line box is the typesetting region built from advance, ascent and descent, and the actual outline can extend past it because of italic overhang or decorative marks. Clipping cannot be decided from the logical box alone, and you must choose between the visual boundary and the typesetting boundary depending on the purpose. This difference is not a quirk of a particular browser but a general property of digital typography.</p>
<p>When promoting an imported structure into the editing model, too, I judged by the amount of information lost. Headings and paragraphs with clear meaning can be normalized into simpler native structures, but if you hastily flatten regions with complex selectors and mixed content, the original representation cannot be restored. Convertibility was decided not by node type but by whether information is preserved between meaning and representation.</p>
<h2>Durable IR</h2>
<p>A rendering tree cannot be a persistent document format. Anonymous boxes, caches and session addresses computed by the browser mean something only in the current execution environment and do not guarantee the same identity in the next run. What has to be stored is not the objects on screen but a declarative intermediate representation from which the same screen can be computed again. The durable IR had to include the semantic structure, the causes of styles and asset references.</p>
<p>Serializability does not simply mean it can be turned into JSON. Every reference in the tree has to be resolved within a namespace, cycles and sharing relationships have to be explicit, and the meaning of each field has to be interpretable even across versions. Only when ephemeral caches, selection and layout boxes are excluded, leaving just the source document and the editing intent, can the screen be materialized again from the same input.</p>
<p>Asset references, too, must be logical identities rather than location addresses. If you store a URL or pointer valid only in the current process, the file may exist but the connection cannot be restored. A durable reference uses values independent of the environment, such as a name inside the package or a content identity, and is turned into a handle the current runtime understands at the load stage. The separation of names from actual memory addresses is like the relationship between a linker and a loader.</p>
<p>Restoration should be the inverse of saving, but it need not be a complete byte-level inverse function. It is enough if <code>decode(encode(x))</code> is semantically equivalent to the original x. Here, equivalence means the same paragraph order, styles and asset relationships, and transient node addresses need not be the same. By defining the round-trip property as a semantic invariant, the lifecycle of the screen and the lifecycle of the document were separated.</p>
<h2>Reference graph</h2>
<p>Fixed-layout documents start from the opposite direction to flow documents. They are closer to an object graph in which pages, stories, styles and assets reference one another than to a single tree. File boundaries are only a partition for storage convenience and do not coincide with semantic boundaries. Only after the importer reads several pieces, builds a symbol table and links the references can it describe a single page.</p>
<p>In the link stage, I checked vertex kinds and edge types together. An edge where a text frame references a story and an edge where a page references a template look like the same identifier link but mean different things. If a reference of the wrong type is connected as if it were simply an existing target, the graph looks complete but the document is wrong. Typed graph validation was needed.</p>
<p>Where cycles are allowed in a reference graph also differs from place to place. An inheritance cycle of colors or styles cannot settle a value, but fan-in, where several nodes point to a shared asset, is normal. A story's reading path must have an order, and in the group ownership tree one object must not have two parents at once. Instead of applying a single rule to the whole graph, I defined invariants for each edge meaning.</p>
<p>Importing was not a process of baking the graph into one background image. It is a process of moving the relationships among manuscripts, frames, templates and assets into a common intermediate representation so that they can be selected and edited again. By lowering to a typed scene graph and style graph without exposing the surface XML names as they were, a stable compiler boundary formed between the format's details and the editing model.</p>
<h2>Affine decomposition</h2>
<p>Coordinate conversion between fixed-layout formats does not end with unit conversion. An object's transform is an affine map <code>p' = Ap + t</code>, and an object inside a group has to multiply the matrices from the root down to itself in order to get its world position. Matrix multiplication is not commutative, so the coordinate convention and the direction of composition have to be fixed first.</p>
<p>Decomposing the matrix A into the rotation, scale and shear familiar to users is not unique either. Using the polar decomposition <code>A = RS</code>, R is an orthogonal rotation or reflection and S is a symmetric stretch. The eigenvectors of S describe the principal axes of stretching and the eigenvalues describe the scale on each axis. This decomposition preserves the actual geometry of a skewed transform better than simply back-computing an angle.</p>
<p>Numerically, the determinant and condition number matter. When the determinant is near 0, the area almost vanishes and the inverse becomes unstable. But the determinant alone cannot fully describe an ill-conditioned matrix with one axis stretched a lot and the other shrunk. Only by looking at the ratio of the singular values as well can you judge how much a small error in the input coordinates gets amplified in the output.</p>
<p>I also could not simplify every transform into a rotated rectangle. An affine map with shear or reflection does not preserve right angles, and free curves have to pass through the same map including their control points and tangents. If you discard degrees of freedom the representation model cannot handle, the geometry changes at the moment of import. When simplifying a transform, it was right to measure the approximation error and, if it fell outside the tolerance, keep a more general path representation.</p>
<h2>Style lattice</h2>
<p>A text style was the composition of partial functions from several scopes rather than a single object. Document defaults, paragraph styles, character styles and direct overrides offer candidates for the same property. Each layer does not define every property, so a style can be seen as a partial map from a set of properties to values. The final value is obtained by composing, in order, operations in which definitions from the nearer scope override those from the farther one.</p>
<p>This structure resembles a lattice in some ways. <code>undefined</code> is the bottom value not yet decided, and an explicit override is a more specific value. However, when incomparable candidates arise, like two different direct overrides, source order or an explicit priority is needed. If you think of style merging not as an object spread but as a selection among values that have origins, it becomes easier to preserve causes in editing and round trips.</p>
<p>The units of typography values also differ by meaning. Font size and baseline shift are lengths, but line-height can be a length or a dimensionless ratio, and tracking is sometimes interpreted as a value relative to the font size. If you multiply every number by the same scale, the units break. Only by distinguishing quantities that have dimensions from ratios, and normalizing to a base unit, does the typographic feel survive between different document languages.</p>
<p>Color is a coordinate transform too. Device-dependent CMYK and screen RGB are not a simple reduction from four numbers to three, and depend on the profile and rendering intent. A gradient is an interpolation function over a color space, defined together with alpha and stop positions. In importing, I had to distinguish values for the screen preview from the original color definitions, keeping both the result of the representation and the publishing meaning.</p>
<h2>Constraint migration</h2>
<p>Changing the trim size of an imported document was not a transform that multiplies every coordinate by the same scale. Text flow has to be re-optimized at the new width, and objects whose physical position matters, like logos and photos, have to keep their relative coordinates or anchors. Backgrounds and margin guides must be regenerated from the new page constraints, not by enlarging the old geometry. Each object had a different invariant to preserve.</p>
<p>I saw this as constraint migration. The old solution <code>x_old</code> satisfies the old constraints <code>C_old</code> but does not fit the new constraints <code>C_new</code>. The goal is to find, among the solutions satisfying <code>C_new</code>, the <code>x_new</code> semantically closest to <code>x_old</code>. The distance function can weight position change, size change, reading-order violation and style loss differently.</p>
<p>For free-placement objects, normalized coordinates are useful. If you turn a position inside the old content box into relative coordinates in <code>[0,1]²</code>, you can restore the proportional position in the new box as well. But this does not suit text and repeated elements. Text must be re-typeset from its source and style at the new width, and repeated elements must be evaluated in the new template context. A constraint that fits the object's meaning mattered more than a single conversion formula.</p>
<p>You also have to consider cases where no solution exists. Objects with minimum sizes may not all fit on the new page, or keep constraints may conflict with each other. In that case you have to relax the constraints by priority and record which conditions were broken. Without distinguishing hard constraints from soft constraints, a solver can silently produce a wrong layout.</p>
<p>A transformation of the whole document had to be treated as a transaction. An intermediate state in which only some pages have the new specification is not a valid document. Only after the new solution passes all invariants is the old solution replaced, and if it fails, the complete previous revision is kept. A trim size change came to be organized not as a coordinate edit but as solving the whole constraint system anew.</p>
<h2>The Import Engine Is Done</h2>
<p>At this stage the layout editor became able to absorb different documents into one editing model. Input became a syntax tree in each format's parser, and passed through symbol resolution and graph linking down to a common IR with provenance. The cascade and fragmentation of flow documents, and the typed reference graph and affine geometry of fixed layout, each kept their own meaning within the same compiler pipeline.</p>
<p>The imported result was not a one-time screen. I preserved a durable IR instead of the rendering tree, and separated the causes of styles from computed results, and the logical source text from the physical fragments. For trim size changes too, I arranged things to recompute the closest solution under the new constraints rather than forcibly enlarging the old geometry.</p>
<p>I repeatedly checked it with combinations of various document structures and CSS, different fonts and color spaces, long manuscripts and mixed content, nested transforms and incomplete references. I confirmed that after saving, restoring and changing trim size, the meaning of reading order, style provenance, asset relationships and page geometry was maintained. An import engine that translates different publishing languages into editable pages was fully implemented and stabilized.</p>]]></description>
      <category>dev</category>
      <pubDate>Sat, 18 Jul 2026 00:54:08 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: One Layout, EPUB and Print</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-16?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-16?lang=en</guid>
      <description><![CDATA[<p>Once the layout editor could take in external documents as editable pages, it was time to finish the opposite direction. An edited object has to stay recognizably the same object even when another tool changes it and sends it back, and a fixed page has to be convertible into very different semantic spaces, such as a responsive document or a physical printout. Exporting turned out to be less about generating files than about preserving meaning.</p>
<p>All of these outputs start from the same document, but each has to preserve different invariants. When going back to the original for editing, an object's identity and its editability matter most. In a responsive document, reading order and relationships matter more than fixed coordinates. In print, what matters is the exact page box, physical units, color and fonts. No single general-purpose conversion can optimize all of these invariants at once.</p>
<p>So I decided to build purpose-specific projections out of a common document model. Some projections throw away coordinates and keep the semantic structure; others do the opposite and pin down every bit of physical geometry. A good conversion states plainly what it keeps and what it gives up. Closing the loop that began with import, through the editable source, the responsive document and the printed page, was in the end a matter of defining several different equivalence relations.</p>
<h2>Identity and Value</h2>
<p>The first distinction I drew for the editing round trip was between an object's identity and its current value. Even if an image's pixels or a vector path change, the role that object plays on the page can remain the same object. Conversely, two images that happen to have identical pixels are still two different objects. Equality of value and sameness of identity are separate relations.</p>
<p>Mathematically, a value is an element of some state space V, and an identity is closer to a label that ties a changing series of values into a single trajectory. If I write the visual state of object o at time t as <code>v_o(t)</code>, an edit is <code>v_o(t0) -&gt; v_o(t1)</code>, yet o itself persists. With this distinction in place, I can replace only the content while leaving the surrounding layout and references untouched.</p>
<p>At the boundary where different editing regions meet, there is no need to share the entire internal state. What's needed is a minimal contract describing the identity of the target, the input revision and the meaning of the result. Mixing large assets and small control messages in the same channel couples copying cost to the unit of failure. Separating the control plane from the data plane is a general systems principle that applies not only to networks but to composite editors too.</p>
<p>When two results try to update the same object at the same time, revisions have to be compared. A result computed from stale input must not overwrite the latest state just because it finished later. I check that the revision read when the work started matches the revision at the moment of application, and if it doesn't, the result is merged or recomputed. A round-trip edit isn't a screen transition; it's an identity update with optimistic concurrency control.</p>
<h2>Atomic replacement</h2>
<p>Sending a result back to its place is safer when treated as an atomic replacement than as gradually patching a mutable object. If part of the old value is erased before the new one is fully ready, a mid-way failure becomes a loss the user can see. The old and new revisions should each exist as complete states, and the reference should switch to the new revision in a single step.</p>
<p>This resembles copy-on-write. Rather than overwriting an existing asset A, I create a new asset B, validate it, and only then switch object o's value from A to B. Before the switch every reader sees A, after it every reader sees B, and nobody ever sees a half-written asset. It is the same principle as an atomic rename in a filesystem or a commit in a database.</p>
<p>When the new value has a different aspect ratio, what to preserve also has to be decided as a constraint. Position, width, height, center point and area can't all be kept at once. If I fix the width w and apply a new ratio r, for example, the height is determined as <code>h = w/r</code>. Replacement becomes predictable once I separate the variables the user decided directly from those derived from the content.</p>
<p>Removing the old asset is a reachability problem over references. An asset can be judged garbage only when it can no longer be reached from a root, and if a past revision or another document references it, it has to stay alive. Reference counting is weak against cycles, and mark-and-sweep has to see the whole graph. The lifecycle of an editor's assets turned out to be the same problem as ordinary garbage collection theory.</p>
<h2>Geometric reading order</h2>
<p>Recovering reading order from a fixed page is harder than sorting geometry into string order. Which of two objects, A and B, should be read first can't be decided by a single comparison of x and y. Several cues, such as above-and-below relationships, the same row, columns, and the pairing of a caption with its image, combine into a partial order. The goal is to find a linear extension that doesn't violate that partial order.</p>
<p>I treat each object as a vertex and draw a directed edge whenever there is enough evidence that A comes before B. Separation along the y axis, shared alignment lines and containment can all justify an edge, but forcing in uncertain relationships creates cycles. A cycle doesn't mean the visual layout is contradictory; it means the heuristics are in conflict with each other. Weak edges have to be dropped, or semantic metadata given higher priority.</p>
<p>A page's column structure is a clustering problem in computational geometry. Taking each object's x interval and y interval, its alignment lines and the whitespace as features, I can estimate how likely objects are to belong to the same flow. Geometry alone can't fully determine meaning, though, because there's no way to know whether a shape in the same position is decoration or body text. Where explicit structure exists, it should take precedence over observed geometry.</p>
<p>A set of strongly overlapping objects may be a composition that can't be unrolled into a sequential document. Reading order, as a projection, can't preserve all visual information. So I have to distinguish the parts that can be moved into semantic structure from those that must stay as a single visual atom. Conversion from fixed layout to a responsive document is not a complete inverse function; it's an information projection fitted to its purpose.</p>
<h2>Inverse layout</h2>
<p>Recovering responsive structure is the inverse problem of a renderer. A typical layout function L takes a structure S and a viewport v and produces geometry G. Here I have to estimate a possible S from one observed result G. Many different S satisfy <code>L(S, v) = G</code>, so the problem is ill-posed, and it needed an extra regularization criterion.</p>
<p>I can prefer the simplest structure, meaning the candidate that explains the geometry with the fewest containers and the fewest exception rules. This resembles the minimum description length principle. Giving every object an absolute coordinate reproduces the current G perfectly, but the description is long and doesn't generalize to other viewports. A structure described in terms of rows, columns and relative gaps is shorter, even with a little error, and more likely to be responsive.</p>
<p>The objective function can combine the reproduction error against the current screen with the structural complexity. In <code>E(S) = D(L(S,v), G) + λC(S)</code>, D is the difference in position and size, and C is the cost of the number of containers and exception rules. If λ is too small, the result drifts toward an absolute layout; if it is too large, it forces unrelated pieces into a single flow. Semantic metadata and reading order enter as additional constraints.</p>
<p>You can't fully discover responsive rules by looking at a single viewport. So the result of the conversion doesn't preserve every number in the original; it chooses the relationships that should hold across many screens. It gives priority to the meaning and order of text, the aspect ratio of images, and the relationships of the same row or column, and relaxes fine decorative positioning. I judged the correctness of responsive conversion by structural stability under new conditions rather than by pixel equality on one screen.</p>
<h2>Reproducible output</h2>
<p>For the preview to match the final result, I can't count on two independent conversions happening to produce the same screen. The build has to produce a deterministic result from the same source, the same environment and the same tool versions. A reproducible build starts by spelling out the input set, the transformation function and the environment variables.</p>
<p>If I view the output as a function <code>B(source, assets, environment, version)</code>, it becomes easier to find which values are sneaking in implicitly. If the current time, file traversal in arbitrary order, fonts that aren't ready, or a device-specific locale change the result from outside the function, the same document produces different bytes. Only by removing such nondeterministic inputs, or including them in the build manifest, do preview and export come to mean the same thing.</p>
<p>Visual equivalence needed a definition as well. Bytes can differ because of compression order while the rendering is identical, and conversely the HTML string can be identical while a different font version changes the line breaks. Equivalence of document structure, of asset hashes and of final pixels each has to be checked in stages. It had to be clear which layer's sameness was being guaranteed.</p>
<p>So I treated the preview not as a separate mock-up but as a projection of the canonical build observed in one environment. The final deliverable must also come from the same source graph and the same transformation revision. By cutting down independent reinterpretation steps between the state the user approved and the state that gets published, the round trip between fixed pages and responsive documents settled into a reproducible production process.</p>
<h2>Deterministic rendering</h2>
<p>Print rendering wasn't a matter of capturing the editing screen. The editing screen is mixed with state that isn't part of the document's meaning, such as selections, guides and temporary caches. Output has to start from the durable document graph and be materialized into physical page space. Removing view state wasn't a trick for deleting certain DOM elements; it was the result of separating the source model from its projection.</p>
<p>The renderer walks the scene graph in painter's order and accumulates each node's local transform to convert it into page coordinates. Transparency compositing depends on order, so a different z-order turns the same set of objects into a different image. Even the blending color space and whether alpha is premultiplied have to be fixed before the same scene gives similar results on every device.</p>
<p>What to keep as vector and what to rasterize can be judged by the closure of operations too. Affine transforms and simple fills are closed within a vector representation, but some filters and blend effects may not mean the same thing on the output device. In that case, sampling only those parts at a fixed resolution and color space while keeping the remaining geometry as vector strikes the balance between quality and compatibility.</p>
<p>The final page box must not contain screen zoom or device pixel ratio. The document's physical units and viewBox are the reference, and the output device converts them to its own sampling grid at the very end. By removing the editor's transient state and device-dependent variables, I made sure the same page graph lands in the same physical positions no matter when it is rendered.</p>
<h2>Glyph closure</h2>
<p>A font subset isn't simply a matter of collecting the Unicode characters that appear in the document. Once shaping is applied, a character sequence can become a ligature glyph, and one glyph can reference other composite glyphs. OpenType substitution and positioning tables also select additional glyphs depending on script and language. The set that's needed isn't a simple image of the character set but the reachable closure of the shaping graph.</p>
<p>Starting from an initial glyph set G, I repeatedly follow composite references and substitution edges, expanding until no new glyphs appear, and that yields the least fixed point. With <code>G_(n+1) = G_n ∪ refs(G_n) ∪ subs(G_n)</code>, the point where <code>G_(n+1)=G_n</code> is the closure. Only the outlines and metrics outside this set may be removed if the typesetting relationships the document needs are to survive.</p>
<p>Metric tables and glyph index reassignment move together as well. If only the outlines remain while the character map, advance widths or kerning pairs still point to the old indices, the file opens but the letters come out wrong. Subsetting is the construction of an induced substructure of a graph, and every referencing table has to be carried over isomorphically into the new index space.</p>
<p>Font preparation is also a rendering barrier. Line breaks computed with a fallback font become invalid once the right font arrives. So the condition for “the page is ready” has to mean that the faces and metrics needed for shaping are settled, not merely that DOM creation has finished. Putting glyph closure and font readiness inside the same output contract made the typography on screen and in print match.</p>
<h2>Print geometry</h2>
<p>A screen document and a print document start from the same scene but live in different measurement spaces. The screen adapts to logical pixels and the viewport, while print is based on physical length, device resolution and the cutting process. Unless I attach a dimension to every quantity instead of mixing points, millimeters and pixels, zoom or DPI will change the size of the document.</p>
<p>A printed page isn't a single rectangle but a containment relationship among the media, trim, bleed and content boxes. <code>content ⊆ trim ⊆ bleed ⊆ media</code> must hold, and it must be clear which box each mark is defined against. If coordinates are derived from the box edges and offsets rather than written out page by page, the same geometric rules hold even when the trim size changes.</p>
<p>Raster resolution should be seen through the Nyquist lens too. Aliasing shrinks only when the sampling frequency is sufficiently higher than the spatial frequency of the finest lines and letter details. An indiscriminately high DPI only inflates memory and throughput, so it made more sense to separate elements preserved as vector from raster effects, and then calculate the resolution needed for the parts that are actually sampled.</p>
<p>Color space conversion is also a mapping from device-independent color to the output device's gamut. Where out-of-gamut colors get sent makes perceptual and relative colorimetric results differ. The RGB numbers on screen can't simply be copied into print channels; a profile and a rendering intent are required. Only by including physical geometry and color management did print output become a single, complete mathematical transformation.</p>
<h2>Graph isomorphism</h2>
<p>Moving a project to another environment is closer to a graph isomorphism problem than to copying files. If the original document is a graph <code>G=(V,E)</code>, the graph <code>G'</code> in the new environment must have a correspondence function <code>φ:V-&gt;V'</code> that preserves edge relationships and node types, even if the vertices' actual names differ. What matters is not that the identifier strings are the same but that the structure is.</p>
<p>In a new namespace, the original identifiers may already be in use by other objects. So φ has to be injective, and every reference edge <code>(u,v)</code> has to be carried over together as <code>(φ(u),φ(v))</code>. If I create only new vertices and leave the old names inside the edges, the graph appears to exist but isn't closed. Namespace migration is a substitution applied to the entire structure.</p>
<p>Shared assets have to be preserved too. If two objects originally pointed at the same vertex, they must point to the same new vertex after restoration. Copying each reference independently splits what was one asset into several and changes the identity relationships. Only when φ is defined once as a global function and every edge uses the same mapping is the graph's sharing topology maintained.</p>
<p>Restoration is a transaction. Until the new graph is completely built and every vertex's type and the edge closure have been verified, it must not replace the existing healthy graph. A failed candidate graph is discarded and the previous revision stays. Even when every identifier is different on another computer, if the relationships among pages, styles and assets are the same, it can be stated mathematically that it is the same project.</p>
<h2>A Closed Production System</h2>
<p>By this stage, the role of the layout editor had been fully sorted out. The editing round trip became a revision replacement that separates identity from value, and asset changes could be explained by copy-on-write and a reachability-based lifecycle. Getting reading order from a fixed page became a linear extension of a partial order, and responsive structure became an inverse layout problem with minimum description length.</p>
<p>On the print path, the same document is pinned down by an entirely different equivalence relation. A reproducible build fixes the source and the environment, glyph closure closes the font graph needed for typesetting, and a deterministic renderer projects the scene graph into physical page space. Print geometry and color space were completed as transformations with a different dimension and gamut from the screen.</p>
<p>I repeatedly reviewed concurrent edit revisions, atomic asset replacement, complicated reading order, structural stability across viewports, font substitution, extreme page ratios and graph migration. I confirmed that the preview and the final result mean the same thing, that the box relationships of physical output hold, and that the project graph is restored isomorphically even in a new namespace. Opkle's production system, which runs from vector work through layout, EPUB and the web to real printed matter, was fully closed and stabilized at this stage.</p>]]></description>
      <category>dev</category>
      <pubDate>Sat, 18 Jul 2026 00:54:08 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: Turning Rust into a Graphics Engine</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-11?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-11?lang=en</guid>
      <description><![CDATA[<p>If Part 10 set up the frame of the Rust/WASM factory, the next job was to refine it into an engine the graphics editor could call with confidence. The idea of simply writing a few fast functions in Rust was not enough. A graphics editor is a tool users keep touching by hand. Placing an image, correcting color, blurring, touching up with a brush, saving assets, loading them again and exporting: all of it has to move inside one workflow.</p>
<p>So I divided the Rust code by the nature of the computation rather than by algorithm name. Point-wise transforms that read a single pixel, local operations that reference neighboring pixels, geometric operations that change the coordinate system, and structural parsing that reads a whole document each differ in time complexity and memory access. If you lump them together just because they are all image processing, the lifetimes of temporary buffers and the error conditions get mixed up. I drew the boundary so that TypeScript handles interaction and document state, while Rust takes the areas where contiguous memory and numerical computation matter.</p>
<p>Still, I did not project this structure onto the outside callers as it was. The internal representation of the computation module and the browser's object model change at different speeds. At the boundary, only the shape of memory, the unit of coordinates, the color representation and the failure conditions remain as a contract, while the data structures and optimizations used inside stay hidden. A good FFI is not a window into the internal implementation; it is closer to a narrow mathematical contract that lets two different runtimes exchange data without misunderstanding.</p>
<h2>Decomposing the Computation Layer</h2>
<p>The first principle of the Rust core was not to mix computation scopes. Point-wise operations map only the same position of input and output, so they are easy to parallelize and split into tiles. Convolution needs neighbors out to its radius, so tile edges need a halo. A geometric transform has to compute the inverse function to find which position of the source each output pixel references, and in file parsing the length and version read earlier decide the meaning of what comes later. All four deal with bytes, but their conditions for correctness differ.</p>
<p>This classification connected directly to complexity analysis. For an image of width W and height H, a point-wise transform is generally <code>O(WH)</code>. Applying a 2D kernel of radius r as it is gives <code>O(WHr²)</code>, but if the kernel is separable it can be brought down to <code>O(WHr)</code>. For vectorization or document parsing, the cost cannot be explained by pixel count alone; the complexity of boundaries, the number of path segments and the size of the reference graph all come in. Throughput estimates had to start from the input dimensions, not from the feature name.</p>
<p>From the memory point of view, I distinguished read-only input, mutable output and reusable work buffers. If input and output share a buffer, memory shrinks, but neighbors not yet read can be overwritten first. Conversely, making a full copy at every stage makes bandwidth a bigger cost than the computation itself on large images. It was important to separate the operations that are mathematically safe in place from those that need a separate buffer, and to keep the maximum lifetime of intermediate arrays short.</p>
<p>This division also makes the meaning of a call clear on the front end. A tool on screen forms the user's intent, and the computation layer performs a transform with a clearly defined domain and codomain. What the user sees is one graphics editor, but internally the computation is separated by locality, complexity and memory ownership. With this criterion in place, the whole factory does not collapse into one giant conditional as tools multiply.</p>
<h2>The WASM Input/Output Boundary</h2>
<p>I was fairly careful in setting the boundary between Rust and TypeScript, too. Different runtimes differ in object memory layout, string representation and exception handling. So rather than handing over one side's rich object as it is, you have to state the minimum information needed for interpretation: dimensions, stride, channel order and byte length. Even for the same four-channel image, the result is completely different depending on whether it is RGBA or BGRA, whether there is padding between rows, and whether the color values are linear light or gamma-encoded.</p>
<p>In linear memory, even a 2D image is laid out in a single line in the end. In a row-major image, the channel start of coordinate <code>(x, y)</code> is usually computed as <code>base + y × stride + x × channels</code>. If you assume <code>stride = width × channels</code> here, you can misread input that has extra bytes at the end of each row for alignment. The contract had to include not only width and height but the actual row spacing, and the last access position had to be validated in a large-integer space to make sure it does not exceed the total buffer length.</p>
<p>The number of memory copies was part of the API design as well. Moving a browser object into the computation module's linear memory and taking the result back out costs at least two passes of bandwidth. If you call small operations many times, the same image crosses the boundary again and again. So where possible, it is more efficient to bundle a series of operations into one computation graph, let the input cross the boundary once, finish several stages, and get back only the final result. It was a matter of reducing the number of data movements, not the number of functions.</p>
<p>What mattered at the WASM boundary was a steady API, more than a convenient one. Once the caller starts to know the internal data structures, swapping an optimization or an algorithm becomes a compatibility problem. At the boundary I left only the units and permitted ranges of the input, the ownership of the output, and whether state changed when an error occurred. With this contract clear, the inside of the computation can change from a scalar loop to SIMD, or from whole-buffer to tile processing, and the outside meaning stays the same.</p>
<p>Mathematically, this boundary can be expressed as a domain, a codomain and invariants. If D is the set of images the function can accept and C the set of normal outputs, an implementation that merely satisfies <code>f: D -&gt; C</code> is not enough. It also has to preserve invariants such as alpha range, dimensions, color space and determinism. For invalid input, it must clearly report that it lies outside D and leave no partial result. This functional boundary is what made the computation engine a stable black box.</p>
<h2>Pixel Functions</h2>
<p>This Rust factory was, in the end, also a mathematics factory. Phrases like “blur the image slightly,” “keep only the bright areas” or “restore a specific part with a brush” look simple in the UI, but inside the engine they all turn into math problems. A color is a vector, a pixel buffer is a function on a grid, and a filter is an operator that sends that function to another function.</p>
<p>An RGBA image can be seen as a function like <code>I: Z² -&gt; [0, 255]^4</code>. At each integer grid coordinate <code>(x, y)</code> sits a vector with four components: red, green, blue and alpha. Some filters change each pixel independently. Levels, invert and HSL adjustment are mostly pointwise transforms that send one pixel's color vector to another color vector. Blur, sharpen, healing and perspective sampling, on the other hand, also look at relationships with surrounding pixels. From there on, local neighborhoods, interpolation, kernels and weighted averages come in.</p>
<p>This distinction affects the code structure directly. Pointwise transforms are easy to parallelize and have simple memory access patterns. Convolution and bilinear sampling keep referencing surrounding pixels, so cache locality and boundary conditions matter. Brush tools add a mask function on top. A radial weight field is built inside radius r around the user's mouse position, and that weight is mixed into the alpha composition.</p>
<p>Putting in a lot of math should not make the editor look more complicated. Users touch only sliders and handles. Inside the Rust factory, though, coordinates, colors, probabilities, curves, matrices, compression and page assembly have to move within clear boundaries. The polish of a graphics editor ultimately depends on how quietly and stably this math layer runs.</p>
<h2>Validating Pixel Buffers</h2>
<p>The most basic thing in image work was pixel buffer validation. In a graphics editor you cannot know what size of image the user will bring in. Even if the front end has already checked, the Rust core has to check again. When computing width × height × 4, I did not compute it directly in u32; I computed it in u64 first and then checked the usize range. It looks like a small habit, but on the WASM side this kind of defense matters.</p>
<p>If the pixel buffer length is shorter than expected, an error is returned immediately. When an ImageBuffer cannot be created, that too comes back as a clear error. Inside the Rust factory I decided not to allow silent failure. If a wrong pixel quietly passes in graphics editing, it can later turn into on-screen artifacts, export errors or a corrupted saved file. When something is going to fail, it is better to fail early.</p>
<p>Color values are mostly clamped to the range 0 to 255. Operations like blur, noise, curves, HSL, sharpen and the healing brush easily let floats spike in intermediate calculations. When sending results back down to u8, they must be fitted to the range. Laying this handling down as a common practice keeps the output format steady even as more filters are added.</p>
<p>I kept watching the alpha channel too. JPEG has no alpha, while PNG and canvas do. SVG rasterization delivers premultiplied alpha, and when exporting to PNG it has to be turned back into straight alpha. In perspective transforms and bilinear sampling as well, if the RGB of transparent pixels gets mixed in, black borders can appear. So how the alpha space is handled directly affects graphics quality.</p>
<p>Mathematically, alpha is not just a fourth channel. The result of an operation differs depending on whether RGB holds actual color values or a premultiplied vector multiplied by alpha. If you linearly interpolate <code>(r, g, b, a)</code> as it is in straight alpha, the meaningless RGB of transparent pixels can contaminate the color. In premultiplied alpha, on the other hand, you interpolate <code>(ar, ag, ab, a)</code> and finally divide by a to return to straight space. This difference is immediately visible at the edges of a perspective transform, at the semi-transparent borders of SVG rasterization, and in brush feathering.</p>
<h2>Blur and Noise</h2>
<p>Blur looks like a basic effect in a graphics editor, but in the actual implementation cost management mattered. Running a 2D kernel as it is makes the amount of computation grow quickly with pixel count and kernel size. So I split the Gaussian blur into separable convolution. A horizontal 1D pass runs first, and its result is processed again by a vertical 1D pass. It relies on the property that the 2D Gaussian <code>G(x, y)</code> can be factored into <code>Gx(x)Gy(y)</code>.</p>
<p>The kernel is built from sigma. The basic form is <code>exp(-(x²)/(2σ²))</code>, and the radius is set to roughly 3σ. Since most of the Gaussian distribution's mass falls within that range, a continuous function with infinite support can be approximated by a finite discrete kernel. The weights are normalized to sum to 1. That way blur does not darken or brighten the image, and behaves like an averaging operation that preserves total energy.</p>
<p>I put an upper bound on sigma as well. A user can push the slider all the way, and odd values can come in from outside. NaN, Infinity and values of zero or less are handled defensively, and an excessively large sigma is clamped to the upper bound. Even when brush and filter values come from the UI, the core has to validate them again.</p>
<p>I added noise to create a film-grain feel. Instead of pulling in a separate large random-number dependency, I used a small PRNG. Considering WASM binary size and dependencies, such a small random generator was enough. Given a seed, it produces reproducible results, and if the seed is 0 it creates an automatic seed based on some of the input pixels and the image size. Even the same filter can produce a subtly different texture each time.</p>
<p>Noise is not simply a matter of adding random numbers either. When a pixel value is near 0 or 255, the added value is clamped and the distribution gets cut off. So the visual density of the result is affected by the interaction between noise amplitude and the clamped range. On top of that, the frequency content changes depending on whether you apply blur first or noise first. Blur shaves off high frequencies, and noise injects them back. That is why, for background images and textures, blur alone is too smooth, while adding a little noise looks more natural.</p>
<h2>Color Spaces and Transfer Functions</h2>
<p>Image adjustment was, in the end, a matter of the coordinate system that represents color and the functions defined on it. The RGB values in storage often do not correspond linearly to light intensity. If you average gamma-encoded display values as they are, the result can come out darker than the physical average of light. Operations that mix energy, such as blur and resizing, should be done in linear-light space where possible, while the hue and saturation a person adjusts should be interpreted in a perceptual coordinate system suited to the purpose.</p>
<p>A curve is a transfer function defined on a finite interval. When the user sets a few control points, you can interpolate between them to make a continuous function, but depending on where the points sit, the slope can turn negative or overshoot can occur. For adjustments that must preserve the order of brightness, monotone interpolation matters, while for effects that deliberately invert contrast, monotonicity itself becomes a constraint. Even a small curve in the UI carries the function's continuity, differentiability and value range.</p>
<p>In actual pixel computation, rather than solving a continuous function every time, you can sample it into a finite lookup table. If the input bit depth is b, there are <code>2^b</code> possible channel values, and precomputing the output for each reduces the per-pixel cost to almost a single lookup. For higher bit depths or float images, though, the full table gets large, so interpolating between a small table is better. A balance arises between accuracy and cache locality.</p>
<p>A coordinate system that separates brightness from color was not a single right answer either. HSL is easy to explain in a UI but does not guarantee perceptually equal distances, and linear RGB favors compositing but does not directly correspond to the saturation people perceive. Print color spaces in turn depend on devices and profiles. So instead of forcing every tool into one color space, I set up a conversion scheme that moves into the space that fits the meaning of each operation and then returns to the reference space.</p>
<p>What mattered here was not the number of tools. It was settling in which space which function was applied, whether round-trip conversion preserves the value range and alpha, and whether the same input leads to the same output. Once this mathematical floor is ready, the way controls look on screen can change while the meaning of the computed results stays steady.</p>
<h2>Restoration and Boundary Conditions</h2>
<p>Graphics restoration was closer to a question of how to set boundary conditions than to copying values. When you change the pixels inside a region Ω, it is not enough for the texture inside the region to look natural. If values or gradients at the boundary <code>∂Ω</code> break abruptly against the surrounding image, the human eye finds the seam at once. A restoration result has to satisfy the interior information and the outer boundary at the same time.</p>
<p>A brush mask is a weight function that softens this boundary. If d is the distance from the center and r the radius, it can be normalized as <code>t = d/r</code>, and the weight becomes a function <code>w(t)</code> on the interval <code>[0, 1]</code>. If not just the value but also the derivative approaches 0 at the boundary, the composited brightness change looks more natural. The smoothstep family is used often because it easily secures continuity of slope as well as of position.</p>
<p>Looked at more generally, image restoration can be written as an energy minimization problem. One can think of an objective like <code>min ∫Ω |∇f - v|²</code>: inside, follow the gradient field taken from the source, while at the boundary connect to the target image. Moving to the Euler-Lagrange equation connects it to the Poisson equation. A real-time tool can approximate within its computation budget, but knowing what is being approximated makes clear why texture and low-frequency brightness have to be handled separately.</p>
<p>Compositing is not simple overwriting either. If foreground and background are expressed in premultiplied alpha, source-over has an associative property that preserves color and transparency together. When a spatial weight function enters, one stroke becomes a position-dependent convex combination of two images. If the weight goes out of range, or straight alpha and premultiplied alpha are mixed, bright edges and dark fringes appear.</p>
<p>This stage was also completed stably. The Rust factory was organized not as a mere bundle of WASM utilities but as a graphics computation engine that clearly handles complexity, memory ownership, color spaces and boundary conditions. I reviewed inputs of various sizes and strides, transparent edges, extreme adjustment values and repeated compositing, and confirmed that the determinism and numeric ranges of the results all held steady. With that wrapped up, the next step became much clearer. Deeper inside the graphics engine lay linear algebra and projective geometry, and that part turned out to be a good enough topic to deserve a separate article.</p>]]></description>
      <category>dev</category>
      <pubDate>Wed, 01 Jul 2026 08:44:32 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: Linear Algebra in the Engine</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-12?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-12?lang=en</guid>
      <description><![CDATA[<p>If Part 11 covered refining the Rust factory into a graphics engine, the next place to dig deeper was linear algebra. In a graphics editor, moving an image layer, rotating it, skewing it, changing its perspective to fit four corners, resampling pixels and turning a raster image into vector paths all look like different features on the surface. Inside the engine, though, they are described in nearly the same language: vectors, matrices, bases, coordinate systems, projective space, interpolation, least squares, normalization, and the numerical stability that comes with all of them.</p>
<p>So when you build a graphics editor properly, you can hide the math behind the UI, but you cannot avoid it inside the engine. The user just drags a handle, but the Rust core has to interpret that drag as a coordinate transform. The user just tilts an image, but internally a 3×3 homography is built, its inverse is computed, and a source coordinate is recomputed for every output pixel. The user just presses a button to convert to SVG, but internally a balance is at work between connected components of the pixel grid, boundary tracing, curve approximation and path precision.</p>
<p>This article is a follow-up to Part 11, then, but a record that goes a little further down toward the math. It does not lay out every core design; it is closer to a development log of what mathematical judgments I actually needed when building a graphics engine. The Opkle graphics editor could not be a mere canvas UI. It had to be an editing engine in which coordinates, pixels and vectors can move back and forth between one another.</p>
<h2>Vector space</h2>
<p>The first thing to sort out in the graphics engine was the fact that all data is, in the end, vectors. A pixel's RGB is a 3-dimensional vector, and RGBA is a 4-dimensional one. A point's position is a 2-dimensional vector, and lifting it to homogeneous coordinates for an affine transform makes it a 3-dimensional vector. The channel vector of a color adjustment, a brush's direction vector, a path segment's control points, even coordinates on a PDF page can all be seen as elements of some vector space.</p>
<p>Taking this view changes how you feel about the code. Changing one pixel is not just editing four numbers; it is a function that sends a vector in <code>R^4</code> to another vector. The whole image can be seen as a vector field laid on the <code>Z²</code> grid. A brush stroke is an operation that mixes the vector field inside a particular region with another vector field, and blur is closer to a linear operation that replaces the vector at each position with a weighted sum of the surrounding vectors.</p>
<p>Linearity is very important here. If an operation T satisfies <code>T(a x + b y) = a T(x) + b T(y)</code>, it becomes easy to compose and decompose. Convolution such as blur is a linear operation under ideal conditions. Adding image A and image B and then blurring has the same structure as blurring each and then adding. Of course, in a real engine complete linearity is broken by clamping, gamma, alpha and integer quantization. Even so, it is far more stable to take linear operations as the starting point of internal thinking.</p>
<p>Conversely, HSL conversion, gamma correction, thresholding and clamping are nonlinear. These nonlinear operations feel natural to the user, but they are sensitive to the order of composition. Blurring and then thresholding gives a completely different result from thresholding and then blurring. So in the graphics engine I had to keep distinguishing which processing is linear and which is nonlinear, and in what order they should be chained to look convincing.</p>
<h2>Coordinate frame</h2>
<p>In a graphics editor there is more than one coordinate system. There are screen coordinates, canvas coordinates, coordinates inside a layer, image pixel coordinates and page coordinates for export. The point the user grabs with the mouse lives in screen space, but what actually has to change may be geometry in layer local space. If you do not clearly separate these coordinate systems, the editor soon starts behaving strangely.</p>
<p>In linear algebra terms, each coordinate system can be thought of as a vector space with a different basis. Even for the same point p, the coordinate values differ depending on which basis you view it in. When the canvas is zoomed or scrolled, or a layer is rotated, the mouse coordinates cannot be used as image pixel coordinates as they are. You have to trace the transform matrices backward, bringing the screen point down to a document point and then to a layer-local point.</p>
<p>For this, it is best to unify affine transforms as 3×3 matrices. If you lift a 2D coordinate <code>(x, y)</code> to the homogeneous coordinate <code>(x, y, 1)</code>, translation, rotation, scale and shear can all be expressed as a single matrix product. For example, translation goes into the last column, while rotation and scale go into the upper-left 2×2 block. That way, applying several transforms in order can be composed as a matrix product.</p>
<p>What matters is the order of the matrix product. <code>ABp</code> means apply B to p first and then A. To the user, “moved and rotated” and “rotated and moved” can look similar, but the real results differ. In particular, to rotate around a layer's center you need three matrices: move to the origin, rotate, and move back. Only if the engine pins down this ordering of coordinate systems clearly will the UI's handle movements match the user's expectations.</p>
<h2>Affine layer</h2>
<p>Most basic layer manipulations in a graphics editor are affine transforms. Translation, rotation, scaling and skewing all send lines to lines and keep parallel lines parallel. As long as this condition holds, computing a layer's bounding box and handles is relatively clear-cut. A rectangle becomes a parallelogram, and the internal proportions are preserved.</p>
<p>In formula terms, an affine transform is <code>p' = A p + t</code>. Here A is a 2×2 matrix and t is a translation vector. The determinant of A tells you the area scale and orientation. As the determinant approaches 0, the transform degenerates. The image gets squashed to a line, or its inverse becomes hard to compute. So the graphics engine has to guard against situations where the scale gets too small or the determinant gets excessively small.</p>
<p>The 2×2 matrix A holds several meanings. A pure rotation matrix keeps the lengths of the two basis vectors and keeps them orthogonal. Scale changes the lengths of the basis vectors. Shear changes the angle between the basis vectors. What looks to the user in the UI like “twisted it slightly” is, internally, changing the direction and length of the basis vectors. The transform panel of a graphics editor is, after all, a tool for manipulating the basis.</p>
<p>Getting this structure right also makes undo/redo and export stable. Instead of overwriting the pixels on screen each time, you can store the original asset and the transform matrix separately. The user can rotate and scale many times, but internally the original and the transform information are kept as long as possible and rasterized only when necessary. That reduces the quality loss from repeated editing.</p>
<h2>Projective geometry</h2>
<p>But if a graphics editor deals only with affine transforms, its expressiveness soon hits a wall. To make a poster look pasted on a wall, to flatten an image shot at an angle, or to fit an image layer by freely placing four corners, you need a projective transform. From here on, parallel lines no longer have to stay parallel. It is the moment of moving from affine geometry to projective geometry.</p>
<p>A projective transform is expressed as a 3×3 matrix H in homogeneous coordinates. Lift a 2D point <code>(x, y)</code> to <code>(x, y, 1)</code>, compute <code>H[x, y, 1]^T</code>, and divide by the last component w to get <code>(x'/w, y'/w)</code> again. The moment w comes in is important here. In an affine transform the last component always stays like 1, but in a projective transform w varies with position. As a result, perspective appears, shrinking toward the distance.</p>
<p>In projective space, <code>(x, y, w)</code> and <code>(λx, λy, λw)</code> represent the same point. A coordinate is defined not by a single representative value but by a ratio. This view feels unfamiliar at first, but it is extremely convenient when handling perspective transforms. Points at infinity can be expressed, and vanishing points of parallel lines come inside the same mathematics. For a four-corner transform in a graphics editor to look natural, the engine has to handle this projective space exactly.</p>
<p>This is also why four point correspondences can determine a homography. A single 3×3 matrix has 8 degrees of freedom apart from scale. The condition of sending four points of a quadrilateral to four other points gives two constraints per point, x and y, for 8 constraints in total. So a four-point correspondence in general position determines exactly one homography. The user moving the four corner handles is precisely specifying this 8-degree-of-freedom transform.</p>
<h2>DLT and Normalization</h2>
<p>To find a homography, you set up linear equations from the correspondences. Given a source point <code>p = (x, y, 1)</code> and a target point <code>p' = (u, v, 1)</code>, you can form the relation <code>p' × H p = 0</code>. The cross product being 0 means the two homogeneous coordinate vectors point in the same direction, that is, at the same projective point. Rearranging this gives two linear equations in the entries of H.</p>
<p>With four correspondences, eight such equations pile up. H has nine entries counting scale, but in homogeneous coordinates the overall scale is meaningless, so there are eight degrees of freedom. So you can fix the last entry to 1, or normalize by the norm of the whole vector, to pin down the solution. More generally, you can build a matrix A and solve it as a homogeneous least squares problem of the form <code>Ah = 0</code>.</p>
<p>Numerical stability matters here. If the coordinate values are too large, if the four points are bunched on one side, or if they are nearly collinear, the conditioning of the equations gets worse. A small floating-point error can be greatly amplified in the coefficients of H. So I go through Hartley normalization. The centroid of each point set is moved to the origin, and the scale is adjusted so that the average distance is about <code>sqrt(2)</code>. Then the homography is computed in normalized coordinates and finally converted back to the original coordinate system.</p>
<p>This normalization looks like simple preprocessing, but it affects result quality quite a lot. Even with the same four points, if the coordinate system is stable the matrix computation wobbles less. In a graphics editor, users can work with a very small layer, work on a very large canvas, or squash the corners nearly into a line. Even in such situations the engine has to produce results that are as predictable as possible.</p>
<p>Internally, there is no need to expose every detailed formula in the UI. The user just grabs and moves four corners. But inside the Rust factory, those four points become linear equations, those equations are stacked into a matrix, that matrix's stability is checked, and the result leads on to pixel sampling. This chain has to hold firm for the perspective tool to feel like a real tool.</p>
<h2>Inverse mapping</h2>
<p>Getting the perspective transform matrix does not finish the work. You still have to produce the actual image. The important choice here is between forward mapping and inverse mapping. Forward mapping sends each source pixel to a target position. It is intuitive but has a problem: some pixels of the target image may receive no source pixel at all, leaving holes. Holes appear even more easily once scaling or perspective distortion is involved.</p>
<p>So it is more stable to set up rendering as inverse mapping. Walking through the center <code>(u, v)</code> of every pixel of the output image, you use the inverse matrix <code>H^-1</code> to find which coordinate <code>(x, y)</code> of the source image it came from. Because the whole output grid is traversed without gaps, no holes appear. If the source coordinate is outside the image it is treated as a transparent pixel, and if it is inside, you sample.</p>
<p>The source coordinate usually does not land exactly on integer coordinates. You get real-valued coordinates like <code>(12.37, 45.82)</code>. If you pick the nearest pixel by nearest neighbor, you get a staircase effect. With bilinear interpolation, you take the weighted average of the four surrounding pixels according to the fractional parts in the x and y directions. If the fractional part in x is tx and in y is ty, the weights of the four pixels are <code>(1 - tx)(1 - ty)</code>, <code>tx(1 - ty)</code>, <code>(1 - tx)ty</code> and <code>tx ty</code>.</p>
<p>This interpolation is small math, but it makes a big difference in quality. Especially for images with text or graphics with sharp edges, nearest neighbor looks rough while bilinear looks far more natural. Higher-order interpolation could be considered, but in an editing engine called repeatedly in WASM, the balance between cost and quality matters. For real-time manipulation, bilinear is a pretty good default.</p>
<p>When alpha comes in, things get more delicate. If you interpolate straight RGBA as it is, the RGB of transparent pixels mixes into the result and a fringe appears. So you need to interpolate in premultiplied alpha space and then convert back to straight alpha. In formulas, first send <code>(r, g, b, a)</code> to <code>(ar, ag, ab, a)</code>, take the weighted sum of the four pixels, and, if a is greater than 0, restore to <code>(ar/a, ag/a, ab/a, a)</code>. This small difference makes the edge quality of a perspective transform.</p>
<h2>Singular Values and Condition Number</h2>
<p>For understanding graphics transforms, a more direct tool than eigenvalues was the singular value decomposition. Any matrix A can be decomposed as <code>A = UΣVᵀ</code>. The column vectors of V are orthogonal directions in the input space, the diagonal entries of Σ tell how much each direction is stretched, and U gives the directions the stretched axes point to in the output space. Even a transform that combines rotation, non-uniform scaling and reflection can be read geometrically within this decomposition.</p>
<p>For a 2×2 affine matrix, if the largest singular value is <code>σ_max</code> and the smallest is <code>σ_min</code>, the condition number is <code>κ(A) = σ_max / σ_min</code>. If the two are similar, a circle turns into an ellipse of similar proportions, but if the ratio is very large, one direction stretches a lot while the other is squashed almost into a line. As <code>σ_min</code> approaches 0, the inverse transform greatly amplifies input error, and the problem stops being about finding one exact coordinate and becomes about how much noise and rounding get magnified.</p>
<p>Singular values matter from the sampling point of view as well. The footprint a single output pixel occupies in source space is determined by the inverse of the transform. Where there is heavy shrinking in one direction, a wide area of the source must be gathered into one pixel, so a low-pass filter is needed, and where there is enlargement, detail that does not exist must be interpolated. In an anisotropic transform the scales of the two axes differ, so a single global resolution cannot prevent aliasing and blur at the same time.</p>
<p>In a projective transform, this analysis has to be redone at each position. A homography is not globally linear, but near a point it can be linearized with the Jacobian. Taking the singular values of the Jacobian <code>J(u, v)</code> at an output position <code>(u, v)</code> tells you in which direction and how much that neighborhood is enlarged or compressed relative to the source. In other words, the quality of a perspective transform is not a matter of the scale of a single matrix H but of local conditions distributed over the whole space.</p>
<p>You do not need to compute a fully anisotropic filter at every pixel, but knowing the condition number and the local Jacobian lets you identify numerically dangerous transforms. A nearly collinear quadrilateral, an excessively large magnification and inverse-matrix error are all explained in the same language. Linear algebra became a direct criterion for deciding the boundary where computation loses meaning, while still allowing free geometric manipulation.</p>
<h2>Tracing math</h2>
<p>Converting pixels to SVG is not detached from linear algebra either. A raster image is samples on a grid, and an SVG path is a curve on the continuous plane. Tracing is the problem of recovering continuous geometry from discrete data. Perfect recovery is impossible. Instead, you find boundaries so that the shape looks the same enough to a person, and approximate those boundaries with suitable paths.</p>
<p>In binary tracing, you first produce grayscale values and decide a threshold. The Otsu threshold finds the cutoff that maximizes the between-class variance when the pixels are split into two classes. Mathematically, it is the problem of finding the t that makes <code>σ_b²(t) = ω0(t)ω1(t)(μ0(t)-μ1(t))²</code> large on the histogram. For an image that separates well into black and white, this value gives a good dividing point.</p>
<p>Next you look at connected components and boundaries. On the pixel grid you find regions belonging to the same class and follow the boundary of each region. The boundary here is inherently staircase-shaped. An SVG path does not copy that staircase as it is; it approximates it with straight segments or curve segments. Too precise and the path count gets excessive; too simple and the original shape is ruined. Path precision is, in the end, a trade-off between approximation error and data size.</p>
<p>Color tracing is more complex. You group similar colors in a color space and extract the boundary of each color region separately. A color is a point in the RGB cube, and what counts as similar depends on which metric you use. Colors that look close to a person and colors that are close in RGB Euclidean distance are not always the same. So in a graphics engine, rather than treating all the math in its ideal form, you have to choose what looks stable in real production work.</p>
<p>To make the output SVG convenient as a responsive asset, I also sorted out the handling of viewBox and width/height. The viewBox defines the basis and range of the SVG's internal coordinate system. If you hard-code width and height as fixed pixel values, it can become awkward to use inside EPUB or web documents. So I post-processed the output to keep the geometry's internal coordinate system while leaving outer placement flexible.</p>
<h2>Page space</h2>
<p>In page output too, coordinate systems kept mattering. A CSS pixel on screen is not a physical length but a logical unit relative to a reference resolution, a device pixel is an actual raster sample, and printed documents use units tied to physical quantities, like points or millimeters. Storing just the number 100 does not tell you whether it is a length on a screen or on a printout. A coordinate must always come with a unit and a reference space.</p>
<p>This problem can be sorted out with dimensional analysis. If a length L is expressed in print points and the resolution is D pixels/inch, the number of raster samples is computed as <code>N = L × D / 72</code>. Here L is in points and 72 is points/inch, so the units cancel and only N remains, in pixels. Screen zoom must not enter this physical conversion. Zoom is the observer's magnification, not the size of the document itself.</p>
<p>Contain and cover for placing an image in a page are the same kind of similarity transform. If the original size is <code>(wi, hi)</code> and the target box is <code>(wb, hb)</code>, the scale for contain is <code>min(wb/wi, hb/hi)</code> and for cover is <code>max(wb/wi, hb/hi)</code>. Translating by half of the remaining difference gives center alignment. It is a simple formula, but unless you first separate which coordinates are the trim area and which are the actual content area, even the correct ratio gets applied to the wrong box.</p>
<p>Bleed, trim lines and the print marks outside the page are all geometry in the same page space as well. The content box, trim box and bleed box have different containment relationships, and the final page box passed to the output device must hold all of these sets. In a responsive screen the viewport changes the document, but in print the document defines the coordinate system first and the output device samples those coordinates.</p>
<p>Fonts connect to this coordinate system too. Text is not just a string; it is laid out by glyph outlines, advances, kerning and baseline metrics. Even if the same font size is specified on screen and in print, if the actual typeface differs, the line breaks and page count change. For a graphics engine to become a real production tool, not just the math on screen but coordinates, glyphs and physical units had to be preserved with the same meaning inside the file.</p>
<h2>The Hidden Factory</h2>
<p>What I kept thinking about while building this linear algebra layer was making the math invisible to users. The user does not see the determinant. The user does not see a homography's condition number. The user does not see bilinear weights. But if those values are not computed stably, the user feels something is off right away. The handles shake, the image edges get dirty, and the exported result is subtly misaligned.</p>
<p>So inside the Rust factory I handled coordinate systems, matrices and sampling as strictly as possible. Input with mismatched dimensions, a nearly singular matrix, inverse mapping outside the domain and mixed alpha representations are all different failure conditions. Rather than treating them as one vague image error, I distinguished each as a violation of a separate mathematical contract. The implementation details need not be exposed, but the invariants the internal computation has to keep had to be clear.</p>
<p>This stage was completed as well. Perspective transforms and vectorization, raster sampling and page assembly were organized not as a list of features but as one mathematical processing flow. Linear algebra and projective geometry, singular values and condition numbers, discrete pixels and continuous curves, color vectors and physical units meshed stably inside the graphics factory. In repeated checks, results stayed consistent under extreme coordinates, near-degenerate transforms, various aspect ratios and output resolutions, and the Opkle graphics editor became a tool with a proper math engine behind its UI.</p>]]></description>
      <category>dev</category>
      <pubDate>Wed, 01 Jul 2026 08:44:32 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: Building Our Own Graphics Editor</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-10?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-10?lang=en</guid>
      <description><![CDATA[<p>Once edits in the preview flowed into real EPUB code, and even the AI was working with HTML and CSS inside that flow, the next gap became quite clear. EPUB is not a format that ends with text. Images, tables, layouts, icons, shapes, backgrounds and decorative elements keep coming in. With media queries, CSS animation and image-sequence video already covered, my thinking naturally leaned toward one conclusion: I needed a dedicated editor for the graphics inside a book.</p>
<p>At first I could have simply bolted on an existing graphics tool. But the graphics tool Opkle Editor needed had a slightly different purpose from an ordinary design tool. It was not for making images to post on the web; it had to create and edit graphics that could be used directly inside an EPUB. Vector images, raster images, SVG, JPEG, PNG, WebP, fonts, compressed project files, the preview and the export pipeline all had to move in one flow. Opening and closing an external tool would never keep that workflow smooth.</p>
<p>So I decided I would have to build a graphics editor like Figma myself after all. More precisely, a graphics editor that lives inside Opkle Editor. Within an EPUB document, you should be able to create an image, draw vectors, apply image filters, convert to SVG when needed, and save it back as an EPUB asset. When someone making a book suddenly needs an image, they should be able to make the graphic in the same workflow, without leaving for another app.</p>
<h2>Penpot's Clojure</h2>
<p>After deciding to build a graphics editor, the first thing I looked into was Penpot. Penpot is a browser-based graphics editor with a structure in the same spirit as Figma. I downloaded the source code and started digging into the ClojureScript side. The goal was not to take the code as it was. I wanted to see what kind of state structure and rendering sense this sort of vector graphics editor has.</p>
<p>A vector graphics editor feels quite different from an ordinary document editor. A text editor centers on blocks, inlines, selection and undo history, while a graphics editor centers on the object tree, transforms, bounding boxes, path data, fills, strokes, layer order, groups, frames, canvas coordinates and hit testing. Even at the moment a user selects a single shape, the coordinate system, transform matrix, screen scale, selection box, resize handles, snapping and z-index all move together.</p>
<p>This was also what I wanted to confirm while reading the ClojureScript code. A graphics editor is not a tool you finish by building pretty UI components. The object model has to come first. I needed to see in what unit a shape is stored, how a group holds its child objects, how frames and pages are separated, which id a selection points to, and what kind of patches pile up on the undo stack.</p>
<p>Seeing that made my own direction clearer. A graphics editor should have an independent document model, but at the boundary where it meets the publishing document it must not lose the meaning of the result. Flowing the internal layers straight into the body text is wrong, and so is leaving only finished pixels and erasing the editability of the original. Separating the editing source from the publishing asset, and keeping only the relationship between the two stable, was the boundary an authoring tool in general needs.</p>
<h2>A New Graphics Vector Editor</h2>
<p>The first thing to pin down in a vector graphics editor was the object model. Rectangles, circles, paths, text, images, groups and frames all have to move inside the same canvas. Each object needs an id, and needs position, size, rotation, opacity, fill, stroke and transform information. With that state in place, selecting, moving, resizing, aligning, duplicating, deleting, undo and redo follow naturally.</p>
<p>I could not carry over the feel of handling blocks in a document editor as it was. Paragraphs flow from top to bottom, but graphics objects overlap on a 2D plane. Several objects can sit at the same coordinates, and the user may select the topmost one, or step into a group and select a nested object. Hit testing and layer order become the center of the editor UX.</p>
<p>Another thing that kept nagging me was the relationship with SVG. For using vector graphics inside EPUB, SVG is a very natural format. But if the editor's internal state is carried around as a single SVG string, editing becomes hard. It was right to manage things as an object tree internally and serialize to SVG at export or preview time. In the other direction, when an external SVG is imported, it has to be convertible into an object tree or a raster result.</p>
<p>I organized the interaction layer on the same principle. If buttons, shortcuts, menus and automation tools each start modifying objects directly, the undo and validation rules soon diverge. Regardless of the input method, selection, transforms, styling and asset replacement should be normalized into explicit commands, and the actual state changes should pass through the same execution boundary. Inputs may take many forms, but the operations a document accepts must be finite and verifiable. It was a textbook application of the command pattern.</p>
<h2>Where WebAssembly Becomes Necessary</h2>
<p>To build a graphics editor properly, I could not put every operation in the same execution layer. Work close to the DOM, such as selection and panel updates, is handled well by the browser's own language, but traversing millions of pixels or parsing compressed binaries has a different computational load and memory access pattern. If an interaction that must finish within one frame and a computation that can take tens of milliseconds or more sit on the same event loop, input lag and frozen screens show up immediately.</p>
<p>So WebAssembly became not just a choice of a fast language but a way to isolate the computation domain. What mattered was the size of the boundary, not the name of the language. If every small function crosses the runtime boundary, the call cost and memory copying can outweigh the actual computation. Hand over a large enough block of pixels or one complete file operation, though, and the fixed boundary cost is spread over a long stretch of computation. Just as in Amdahl's law the non-parallelizable portion sets the upper limit of the overall speedup, the serialization stretch between the browser and the computation module sets the upper limit of perceived performance.</p>
<p>Rust suited this layer well for making memory ownership and failure boundaries explicit. Pixels and files are ultimately contiguous bytes, so length, alignment, lifetime and maximum size have to be settled first. A safe type system reduces invalid references and lifetime problems, but it does not automatically guarantee that bytes coming in from outside are a valid image. So I treated language safety and data validation as separate responsibilities.</p>
<p>A computation module delivered to the browser is not done just because it runs fast. The size of the downloaded binary, the initial compile time, the first-call latency and the memory growth are all part of the user experience. I arranged things so that rarely used features are not all included in the initial boot, the common computation path stays small, and large jobs are prepared at the moment they become necessary. At this stage, I came to judge performance not by a single function's benchmark but by the total latency of transfer, initialization, computation and copying combined.</p>
<h2>The Rust Core Factory</h2>
<p>I began to see this Rust core as a kind of factory. The front end manages editing intent and document state, and hands the computation layer complete units of work. The results also come back not as exposed internal objects but as data with clear boundaries, such as images, vectors and fonts. Once the lifecycle of the UI and the lifecycle of numerical computation were separated, a structural change on one side no longer shook the whole of the other.</p>
<p>The first thing I sorted out was what format conversion really means. A raster image is a set of samples on a finite grid, and a vector image is a set of commands describing shapes and curves. Converting between them is not a mere change of file extension. Turning a vector into a raster means integrating continuous shapes according to the resolution and sample positions, and turning a raster into a vector means estimating boundaries and curvature from discrete pixels. The former is sampling of information, and the latter is model estimation that presupposes loss.</p>
<p>The alpha channel was also an important difference in meaning between formats. When sending semi-transparent pixels to an output that does not support transparency, you first have to decide which background to composite them against. If you simply average channel values while ignoring color space and gamma, edge brightness can change, so where possible it is more accurate to composite in linear-light space and then return to the display space. A file opening and producing a visually identical result were different verification problems.</p>
<p>In the filter layer, I treated the pixel array as the domain of a function. Per-point color transforms can compute each pixel independently, but blur and sharpen read neighboring pixels, and geometric transforms fetch samples from other positions. Depending on the kind of operation, the memory traversal direction, the number of temporary buffers and the boundary conditions differ. Classifying this difference first became the foundation for keeping a consistent performance model as more tools were added later.</p>
<h2>The Image Processing Pipeline</h2>
<p>When building the image pipeline, “it doesn't break” mattered more than simply “it converts.” When receiving an RGBA buffer, width, height and length must always be validated. Computing width × height × 4 in u32 risks overflow, so I compute it in u64 first and then check it against the usize range. If the pixel buffer is shorter than expected, an error is returned right away. Binary data coming from the browser always has to be checked again.</p>
<p>I handled blur the same way. Running a 2D kernel as it is gets expensive for a Gaussian blur. So I split it into separable convolution: a horizontal 1D pass and a vertical 1D pass. The complexity drops considerably, and direct access to the raw buffer cuts the cost of get_pixel/put_pixel. Edges are clamped so that no black borders or folding artifacts appear.</p>
<p>I put an upper bound on sigma, too. Blur strength is a value the user can adjust, but if an arbitrarily large value comes in, the kernel size explodes and overflow or DoS problems can occur. So there is a sigma max, and NaN, Infinity and values of zero or less are handled defensively. Even if the graphics editor's UI slider only sends normal values, the core has to block bad ones again. The Rust core is the last line of defense.</p>
<p>Noise follows the same logic. Textures like film grain are often needed in image work, but just adding uniformly distributed random numbers to the channels does not produce a natural result. The texture changes depending on whether you add the same amplitude along the luminance axis or jitter the color channels independently, and spatially correlated noise has a different frequency distribution from white noise. When a reproducible result is needed, the initial state of the stochastic process is fixed, but the concrete generation method had to be chosen by the statistical properties of the effect and its computational cost.</p>
<h2>Asset factory</h2>
<p>A graphics editor is not a tool that handles just one image. A single project holds vectors and rasters, fonts, the document state and previews all together. So the save format could not be just a compressed file; it had to be a container from which the object graph can be rebuilt. Compression is the problem of shrinking repeated bytes, while a container is the problem of preserving file names, kinds, versions and relationships. Thinking of the two as separate responsibilities is what keeps the document's meaning steady even when the format changes.</p>
<p>What a binary container needs first is self-description and boundary validation. The header tells you by which rules to read, the version determines how to interpret what follows, and the length of each section sets where the next data begins. If you trust a length and allocate memory from it, a single corrupted input can lead to excessive memory use. The total size, the number of entries, each entry's size and the cumulative offset all have to be validated separately, and after reading finishes you also have to check whether any unexplained bytes remain.</p>
<p>I did not judge storage methods by compression ratio alone, either. You have to look at dictionary size and seekability, how much must be rewritten for a small change, where a corrupted block is detected, and the maximum memory needed for decompression. A project with a lot of duplication across assets and a project made mostly of already compressed images give completely different results under the same strategy. The right move was to look at the data's entropy and access pattern first, and then choose the container and compression layers.</p>
<p>A font, too, is not simply a file but closer to a binary database in which many tables reference one another. Glyph outlines, character mapping, advance widths, kerning and name information all move together. Reducing the size does not end with stripping out unused glyphs; the components referenced by composite glyphs and their relationship to the layout tables must also stay closed. After conversion, it is not enough to check that the font reopens; you have to confirm that glyph selection and metrics are preserved for the same string.</p>
<p>Only with this kind of asset engineering does a graphics editor become a real publishing tool. A single image visible on screen has a recoverable relationship to the source document, the fonts used, the color space and the output specification. By including saving and exporting not as extras but as the final stage of the editing model, graphics work became able to withstand the whole lifetime of a project.</p>
<h2>The First Rust Core</h2>
<p>The key point of Part 10 is not yet a finished graphics editor. It is that I laid the computational foundation for building one properly. I looked at the object model and canvas architecture of an existing vector editor, and in the actual implementation I separated the responsibilities: interaction versus numerical computation, editing source versus publishing assets, and container versus compression. From this point on, Opkle Editor was preparing to expand from an EPUB document editor into a graphics production environment as well.</p>
<p>The front end handles the UI, document state, commands and user feedback, while the computation layer handles work where contiguous memory and numerical stability matter, such as pixels, curves, files and fonts. It is not because one language is superior, but because each layer has different time constraints and data structures. Dividing roles this way lets the event loop stay responsive and the computed results stay reproducible, even as features grow.</p>
<p>This stage also settled in a stable way. Everything at the bottom of a graphics system was engineered and fixed: the cost of the execution boundary, memory ownership, the sampling relationship between raster and vector, alpha compositing, pixel buffer validation, container integrity and the reference relationships between font tables. In repeated testing, images of various sizes, corrupted input, transparent edges, long-running computation and the save and restore paths all passed stably.</p>
<p>The next step was to connect this Rust factory to the actual tools of the graphics editor. You have to be able to draw shapes, place images, apply filters, move between SVG and raster, and have AI commands call that work. Part 10 was the starting point. It was the stage where I decided to build the graphics editor myself, and successfully stood up the Rust/WASM-based core that would support that decision.</p>]]></description>
      <category>dev</category>
      <pubDate>Tue, 30 Jun 2026 06:22:54 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: The Preview, Straight to Code</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-9?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-9?lang=en</guid>
      <description><![CDATA[<p>After the queue server was running stably, the next job was to teach the AI how Opkle Editor works. A model writing good sentences is a different problem from it doing proper work inside the editor. Inside the editor, the user is looking at a rendered EPUB preview, but what actually gets saved is the document markup and styles. If a user fixes a paragraph in front of them and the code behind it ends up different, that's a bug. The same applied to the AI. What it did on screen and the code that goes into the EPUB had to move in the same direction.</p>
<p>What I wanted to build was not “an AI that writes markup for you.” Users aren't looking at a code editor. They select a paragraph, click an image, change formatting and give commands right on the preview. The editor then bundles the selected target's current structure, the shared styles in effect, the chapter-level style context, the target address and the user's command, and hands them to the AI. The AI has to read that state and return replacement units and style changes that can actually go into the EPUB.</p>
<p>What mattered here wasn't producing a plausible-looking screen. It was producing edits that can be applied again. The change seen in the preview and the saved document representation have to be the same, and the editor string, the document state and even the local saved state have to follow from the same change. So instead of letting the AI explain freely, I made it accept only patches that can be applied. All the AI can do is fix the structure and styles of the selected target, or run UI actions the editor knows.</p>
<h2>Preview as source</h2>
<p>In Opkle Editor, the preview isn't just a screen for seeing results. It is the surface where editing actually happens. Users work while looking at rendered paragraphs, images and tables, without having to look at EPUB code. But an EPUB is, in the end, made of markup and styles. So an edit made in the preview must always be able to go back to code. If that link is loose, the preview stays a mere preview instead of becoming an editor.</p>
<p>So a selected target had to be not just a screen node but a target with a code address. When a user selects a paragraph, the editor captures that paragraph's address, its current full element representation and the style context in effect. It hands the AI exactly the same. Sending only “make this sentence a bit bigger” isn't enough. It has to be given what the target's structure is now and which shared and local rules are affecting it.</p>
<p>This makes the roles of the preview and the code editor clear. The preview is the surface people touch, and the markup and styles are the basis for saving and export. The AI doesn't stir the preview DOM directly; it has to produce a code patch that can be applied to the target selected in the preview. Only then does a result changed by the AI remain not just on screen but inside the EPUB file.</p>
<p>This approach also fit well with the isolated render environment. The rendering result inside the preview has its own style space, but the editor can connect the target selected in it to the source in the document state. What's passed to the AI is not a piece of text visible on screen but a target context that can be saved again. The preview is an editing screen for people and a structured work target for the AI.</p>
<h2>Selection-bound action space</h2>
<p>For the AI to join preview editing, it needed a different space from the body-text generation path. Body generation writes or polishes sentences that go into the book. Selection-based editing fixes the structure and styles of the selected target. So the premise of this path was an action engine from the start. It runs on the assumption that the user has selected one or more targets in the document and that their current representation and applied styles are given.</p>
<p>The input is each target's full element representation and the style context. The element has to be a unit that can replace the current node wholesale, and styles are divided into book-wide shared rules and local rules close to the chapter. The AI reads this information and interprets the user's request. The result splits into changes that alter the selected target itself and actions that move the editor UI.</p>
<p>This distinction mattered more than I expected. If a user says “make this paragraph blue,” a structure or style patch must be returned. But if they say “open the formatting popup,” the document must not be touched. Only a UI action should be returned. And when two things mix, as in “emphasize this paragraph and open the formatting popup too,” a document change and a UI action can come out together. It is a structure where code edits and UI control can coexist within a single input.</p>
<p>So I restricted the output not to free-form sentences but to a fixed, applicable shape. No explanations, no markdown, no decoration. That's because the editor interprets and applies this result as is. It mattered more for the editor to get a result it could run right away than for the AI to explain things kindly.</p>
<h2>Addressable replace units</h2>
<p>In selection-based editing, I made structural changes always come as whole replacement units. If it only accepted partial fragments, the place to apply them would become ambiguous. Since the selected node has to be replaceable wholesale, the AI must return the complete element for that target. Unless the request asks for a tag change, the default is to keep the existing structure and change only the needed attributes and local styles.</p>
<p>The address must never change. The target address is the coordinate where the editor plugs the patch back in. If the AI drops the address or invents a new one, the result can't be applied. So I fixed it in the instructions to keep the address exactly, and in the cleanup stage a change without an address is discarded. A patch with no coordinate to plug back into is unusable however good it looks.</p>
<p>Even when only styles change, the shape of the replacement unit had to be the same. Even when the work is just adding an override to the shared stylesheet, a consistent result shape keeps the application path simple. In exchange, only targets that were actually changed are included in the result. If targets that weren't changed are repeated every time, needless replacements happen, and the selection state or the undo stack can get disturbed for nothing.</p>
<p>With this contract, a structure made by the AI becomes a stable patch unit between the preview and the document state. The user says “make this paragraph stand out a bit more,” but the server receives the target address and current representation, the AI returns the revised replacement unit, and the editor replaces that node. After that, the serialized document, the editor string and the local saved state follow from the same change.</p>
<h2>Cascading write channels</h2>
<p>I handled styles even more carefully. If you let the AI rewrite the stylesheet at will, the whole EPUB can wobble. So the channels through which selection-based editing can change styles were restricted. One is the local style attached only to an element, and the other is an override appended to the shared stylesheet. Chapter-level styles are given only as read-only context. The AI is blocked from returning a modified version of that channel.</p>
<p>A local style is used for changes that apply to just that one element. When changing the text color of one selected paragraph, or adjusting the margin of one particular image, putting it directly inside that element is more stable. The patch scope is clear. Since it affects only one target, other paragraphs and formatting don't change unexpectedly.</p>
<p>The shared stylesheet is used when a common selector has to change. If you must change a rule that applies to several elements together or the style of a particular class, you append only the new rule at the end. What matters here is append-only. It doesn't rewrite the existing stylesheet or repeat it as is. Since rules appended later win in the cascade, returning only the needed override is enough. It's a way of stacking changes without breaking existing styles.</p>
<p>I made the local context channel never modifiable. That information is merely background for the AI to understand the current state, not a write channel. Whatever value a local rule is setting, if it must change, it is handled through an element-local style or a shared override. Restricting channels like this makes it clear where a style patch goes, and the stylesheet structure at EPUB export becomes predictable too.</p>
<h2>Finite action alphabet</h2>
<p>In preview editing, not every request ends in a structure or style patch. From the same input box, users can also say UI controls like opening the preview, turning on selection mode, adding a chapter or opening the formatting window. Such requests must not be mistaken for document edits. So I needed a finite set of actions the editor can actually perform.</p>
<p>This set is not a list of natural-language descriptions but an alphabet of executable identifiers. The AI can't make up new action names and must return only elements of the set. This alphabet is used as is in the selection-based editing path too. For a pure UI request, the document change is empty and only the action is included. For a request mixing a target edit and a UI command, both are returned. Thanks to that, whether what a user says on the preview is a code patch or a UI action is handled within the same pipeline.</p>
<p>The reason for restricting action identifiers to an alphabet is simple. A command that can't be executed means nothing to the editor. Natural-language requests can be accepted flexibly, but execution must be pinned down by deterministic identifiers. Put the alphabet in the instruction context, filter out unknown elements in the cleanup stage, and only executable commands remain. Even when the AI does the judging, the final output had to come down in the editor's language.</p>
<h2>Pre-generative routing</h2>
<p>What I paid particular attention to was handling requests that can be settled before calling the AI. Input that directly matches an editor UI action, such as preview, new project, add chapter or the formatting window, doesn't need to go all the way to the model. So I built a rule-based router made of normalization and staged matching.</p>
<p>User input isn't taken at face value. First it strips decorative prefixes, tidies whitespace and punctuation, and corrects spellings that often vary. Differences in word spacing are absorbed into a compressed form. Because users don't always type Korean UI commands exactly, this cleanup stage mattered quite a bit.</p>
<p>But the wider the net, the more defense you need. A request to write body text must not be mistaken for a formatting command. So I added a writing veto. When generative intent is mixed in, such as writing, polishing, proofreading, translating, summarizing or continuing, it gives up on UI action matching and passes the request to the body-text path. Conversely, short UI words are managed as a strict set, so that one that happens to appear inside a long sentence isn't immediately routed as an action.</p>
<p>When there is a selected target, I used a more conservative gate. That's because it can be ambiguous whether the user's words are a target edit or a UI command. So UI matching before selection lets through only exact matches and core expressions. I deliberately excluded broad fuzzy matching. When in doubt, it's better to judge by looking at the selection context. This conservatism mattered in preview editing.</p>
<h2>Output normalization</h2>
<p>I didn't trust the model's response as is, either. A UI action response should in principle be a single identifier, but in practice quotation marks, decoration, arrays, objects, periods and explanations within sentences can get mixed in. So the normalization layer absorbs many appearances. It gathers candidates within a structure, and if a single identifier is embedded in a sentence, it catches that too. If multiple candidates appear, it's ambiguous, so it discards them.</p>
<p>Selection-based responses are trickier. Structure and style values can contain nested brackets, so you can't cut out an object with a plain substring. So an extraction that finds the top-level candidate while keeping brackets balanced is needed. It ignores brackets inside string literals and parses first the candidate holding the applicable changes and actions. Even with explanations attached before or after, it has to be able to pull out only the executable object.</p>
<p>The parsed change items are tidied again. If an address is empty, discard it, and if a structure value is wrong, correct or exclude it. The style channels accept only strings, and the action list passes through alphabet normalization to remove unknown elements. If parsing itself is impossible, it isn't accepted and triggers a retry.</p>
<p>Only with this layer does the editor's application rule hold even if the AI gets a little sloppy. We demand strict output from the AI, but the server does realistic recovery. In cases that can't be recovered, though, it doesn't force an application. Changes without an address, unknown actions and uninterpretable structures are discarded or retried. To keep the preview and the EPUB code in agreement, not applying an ambiguous patch is better than applying it.</p>
<h2>Same EPUB</h2>
<p>Once this structure is in place, users can edit an EPUB without looking at code. They select a paragraph in the preview and say things like “make this paragraph smaller,” “center this image,” “make this table look good on mobile,” or “open the formatting popup.” The editor judges whether that is a code patch or a UI action, builds the selection context, tidies the AI response into an applicable form, and reflects only what is possible in the document state.</p>
<p>What matters is that it doesn't change only on screen. The replacement unit changes, an override is attached to the shared stylesheet, the UI action runs, and the result carries through to the editor string and the local saved state. The preview, the code editor and the storage share the same change. The AI is not a separately bolted-on decoration but moves inside the editor's serialization pipeline.</p>
<p>Deterministic routing and selection-based editing complement each other. Routing quickly handles definite UI actions, and the selection-based path produces structure and style patches for the target. Even a request that entered the body-writing path can, if it is judged to be a UI action after all, escape back into the action alphabet. The user types a single natural-language input, but internally body generation, UI routing and selection patches are separated.</p>
<p>As a result, the AI became a worker that follows Opkle Editor's way of writing EPUBs. Some styles must go only on the element, some must be appended after the shared stylesheet, and chapter-level styles must be treated as read-only. Some requests change the replacement unit, and some must run the action alphabet. The address must be kept, the structure must be a complete replacement unit, and the output must keep the strict applicable form. As these rules mesh, the preview edit and the actual EPUB code came to look at the same result.</p>
<p>This stage also came together reliably. The selection context in the preview, the applicable output contract, address-based replacement, append-only shared styles, the finite action alphabet, input normalization, the writing veto, the conservative pre-selection gate, and output normalization and sanitizer were organized into a single AI editing layer. In repeated reviews, preview editing, UI action routing, structure and style patch application, removal of unknown actions, retries and document state reflection all passed reliably. Opkle Editor can now keep the EPUB preview the user sees and the EPUB code that is actually saved in step within a single editing flow.</p>]]></description>
      <category>dev</category>
      <pubDate>Tue, 30 Jun 2026 06:22:54 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: The Valkey Queue Server Basics</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-7?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-7?lang=en</guid>
      <description><![CDATA[<p>Once the LLM structure for making books was settled, the next step wasn't the model call itself. To run an AI feature inside a real product, a user's request has to go in reliably, branch onto an execution path suited to the kind of task, and survive a worker restart without disappearing. And the result has to come back in a form the editor can understand. Without that flow, no matter how good a model you attach, users press a button and then sit through an unstable wait.</p>
<p>Opkle Editor's AI features were never a structure that ends with a single short text request. Some tasks are relatively light, like sentence-level transformations, and others fix the structure of a selected passage. Some turn natural language into editable commands, and some read structure out of an image. Add media tasks with long generation times, and the waiting times and failure patterns become completely different.</p>
<p>So I didn't build the queue server as a mere background worker. This server is not a place that “processes AI requests later” but a layer that coordinates heterogeneous tasks on a single runtime. It divides requests by type, keeps only the latest intent on the same task path, manages capacity and exclusivity on shared storage, and then returns results request by request. To the editor, AI looks like one feature, but behind the scenes tasks with different cost functions and failure modes run separately.</p>
<p>I split the basic storage into a fast state store and a long-lived record store. The fast side suits the task state and result return that users are waiting on. The slower side is closer to tracking which request ended with which result. Users get results quickly, and the server can keep a trail of completed work.</p>
<h2>Typed work domains</h2>
<p>The first thing I divided was the type space of work. Merging all AI requests into one generic input is convenient at first. But if you treat tasks with different input and output spaces the same way, later it becomes hard even to say which invariant was broken. So I separated requests into distinct domains: “changing sentences,” “producing editing commands,” “extracting visual structure,” and “handling long-running media generation.”</p>
<p>Each domain needs a request-level identifier and a path-level identifier. The request level corresponds to a single wait that a user is sitting through, and the path level groups the intent repeated at the same UI spot. If you press several times in the same spot within a short time, the request identifiers multiply but the path identifier stays the same. Without distinguishing the two, the system can't express “how many times it was pressed” and “what is wanted now” at the same time.</p>
<p>This distinction mattered. If you process every past request through to the end, a stale result arriving late can overwrite the latest UI state. Conversely, if you just let past requests silently vanish, the screen waiting on them stays pending forever. So I preserved the request level as the unit of result return, and used the path level as the criterion for picking only the latest intent. In queueing-theory terms, it's a design that coalesces arrival events within the same class while still leaving a termination signal for each arrival.</p>
<p>Splitting by type makes the code longer. But for AI features, a clear contract matters more than short code. Starting with a generic queue is convenient at first, but later it becomes hard to know which task needs which input and which failures are retryable. Because each kind of task has a different failure mode, it was right to set up the result space differently from the start.</p>
<h2>Output invariants</h2>
<p>Each task domain has not just options but an output invariant. Some tasks must not break the structural correspondence between input and output. If paragraph boundaries aren't kept, the editor can't paste the result back into the document, and if the style changes, the author's intent collapses. Some tasks must allow only structures a machine can apply, not prose. However plausible a natural-language reply is, if the editor can't interpret it, the result is a failure.</p>
<p>The contract I mean here isn't at the level of “please write well.” It is the properties that the function from input to output must preserve. A structure-preserving transformation must keep the number and order of its split units. A command-extraction transformation must return only elements from the allowed command set. An extraction-type transformation is valid only if its structure satisfies the schema. A long-running task must end not with a temporary reference but with a result the product can read again later.</p>
<p>Even within the same text-processing path there are modes of different character. Some modes are closer to fixing body text, and some are closer to interpreting short commands. They may look like similar AI buttons on the surface, but the freedom allowed to the model and the validation criteria differ. If you don't fix this difference as a type in the queue layer, the worker ends up treating every request as the same generation problem.</p>
<p>The reason for attaching these invariants at request time is so that retry and validation criteria can differ. A task that only needs to match a schema and a task that must also match structural correspondence can't share the same definition of “success.” Before calling the model, the queue server has to settle what success conditions this request's problem has.</p>
<h2>Latest-intent coalescing</h2>
<p>The core of the queue server was that it doesn't process all requests in a single global order. The global queue is closer to a signal that wakes a worker, while the actual latest intent is kept separately per path. When a user submits a request, the system updates that path's current intent, and the worker later picks up only the latest value for that path.</p>
<p>The mathematical intuition is simple. Given a sequence of requests \(r_1, r_2, \ldots, r_n\) arriving in time order on the same path, the one to execute is \(r_n\), the maximum, and the elements before it are no longer valid solutions. But since there may be clients waiting on the earlier elements, those requests must be closed as “terminated,” not “ignored.” Preserving recency and keeping waiting states finite are conditions that have to hold together.</p>
<p>So I don't simply discard old requests. Requests in the same group that aren't the latest target are returned as cancelled results. Cancellation is a result too. For the front end not to be left holding a pending state forever, the system has to guarantee a clear termination state for each request identifier.</p>
<p>This coalescing solves user experience and cost control at once. When a user presses the same feature several times, the server executes only the most recent intent and closes the earlier ones. The more expensive the task, the greater the effect of cutting meaningless duplicate runs. For AI features to look stable inside a product, this cleanup flow for stale requests was indispensable.</p>
<p>Path identifiers also serve as a protection boundary. Each kind of task has its allowed path rules, and requests outside the rules don't go down to the execution layer. It is a pre-validation in the queue layer that keeps a mistake in the front end or router from leading to an external call and cost.</p>
<h2>Atomic state transitions</h2>
<p>When building the queue on shared storage, the part I paid the most attention to was the atomic boundary. Updating a path's latest intent and signaling the worker that there's work looks simple from outside. But if that update is split into several steps, intermediate states appear. If a worker reads in between, or a new request comes in on the same path again, the recency guarantee can wobble.</p>
<p>So I bound enqueue and requeue into a single atomic transition. The only observable states should be “before the update” and “after the update,” with no half-changed state. It amounts to applying the linearizability of distributed systems on a small scale to a queue update. The worker doesn't see intermediate states and simply reads the latest intent for each path.</p>
<p>Slot acquisition has to be atomic for the same reason. I set a finite capacity set per kind of task. When claiming capacity, I first reclaim expired holds, and only if there is room left do I record a new hold. If this check and record don't finish in one step, two workers could each think they saw the same free slot at once.</p>
<p>This is similar to a fixed semaphore, but each hold is closer to a lease with an expiry time. Even if a worker terminates abnormally and fails to return its slot, the slot gets reclaimed in the next acquisition once time has passed. This is also why short and long tasks are not put in the same capacity pool. To keep waiting in one kind from eroding the responsiveness of another, the resource space has to be partitioned from the start.</p>
<h2>Capacity partitions</h2>
<p>The capacity limit for each kind of task determines the character of the queue server. Some tasks are relatively fast and centered on parsing. Some have longer external generation and result cleanup. Some must wait a long time for asynchronous completion. If you bundle all three under the same concurrency, resource allocation goes out of balance.</p>
<p>From the viewpoint of multi-class queueing, this is a design that gives separate server pools to classes with different service-time distributions. A short-task class can have more concurrency, and a long-task class has less concurrency and a longer lease. Without different limits, long tasks eat into the queue of short tasks, or excessive occupation by short tasks harms the stability of long tasks.</p>
<p>The lifetime of a capacity lease and the lifetime of path exclusivity are not the same either. Capacity is set by actual execution time, while path exclusivity is a standard to keep the same intent from being held too long. Without this subdivision, short tasks would be blocked too long, and long tasks could lose their protection midway and run twice.</p>
<p>When capacity can't be acquired, I don't fail immediately. The latest intent goes back into the queue, and only past requests that are no longer valid are closed. That's because a lack of capacity is temporary backpressure. The queue server doesn't treat this state as an error and lets it try again in the next cycle. The user's latest request is preserved and older requests are terminated.</p>
<p>With this policy, the queue server becomes not a simple wait line but a resource scheduler. Text and media sit under the same name, AI features, but to the server they are completely different workloads. Capacity partitioning is the device that divides these workloads so they don't interfere with each other.</p>
<h2>Lease and exclusion</h2>
<p>Having acquired capacity, you can't start external work right away. You have to check whether the same path is already being processed. So I kept an execution-level registry and a path-level registry separately. The execution level is the set of tasks the worker is actually performing right now. The path level prevents two executions from overlapping on the same intent path.</p>
<p>The execution-level registry is also used to decide on process restarts. If there are no in-flight tasks, it's safe to cut off, and if there is even one, it's better to hold off. Tasks not yet picked up remain in the queue and can be processed again after the restart. What is actually dangerous is a task that has already been picked up and is producing external effects.</p>
<p>The path-level registry is closer to mutual exclusion. If a valid lease remains on the same path, a new execution can't enter. At that point the capacity already claimed is returned and only the latest intent is put back in the queue. It is the device that keeps two workers from producing results at the same time for the same paragraph or the same media spot.</p>
<p>I made the stale judgment conservative. That's because the cost of misjudging a healthy running task as dead is greater than the cost of waiting a little longer. At the same time, so nothing is blocked forever, I also added a sweep that reclaims leases past their time. Even if a registry entry remains after an abnormal termination, the system must eventually converge.</p>
<p>The path lock is another axis. Capacity limits, path exclusivity and the path processing boundary look similar but have different roles. Capacity is the concurrency limit per kind of task, path exclusivity prevents duplicate execution of the same intent, and the path lock is the boundary of the section that processes that path. Because I separated these three, it became clear which state to release in a failure situation.</p>
<p>At this stage the basic structure of the queue server was settled. The typed work space, output invariants, latest-intent coalescing, atomic state transitions, capacity partitioning and lease-based exclusivity meshed into one execution model. The user presses one button, but the server brings that request up to date per path, puts it onto the capacity for its kind of task, records the in-flight state and closes out stale requests. In repeated tests, latest-intent-first processing, duplicate-run prevention, backpressure, restart decisions and stale lease reclamation all passed reliably.</p>]]></description>
      <category>dev</category>
      <pubDate>Tue, 30 Jun 2026 02:30:10 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: The Worker Loop and AI Validation</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-8?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-8?lang=en</guid>
      <description><![CDATA[<p>With the basic structure of the queue server in place, I had to settle how the actual worker would produce and validate results. Putting a request in and claiming capacity isn't enough. AI results can drift in format, external generation can take a long time, and media results must not end up as briefly living external links. The worker had to be both the place that runs the request and the last line of defense that turns the result into a form the product can use.</p>
<p>I didn't cram the worker into a single function. Each task domain has a different executor. What they share is that they collect arrival signals, group them by path, pick only the latest intent, claim capacity and exclusivity, and then hand off to asynchronous execution. What happens after that, though, differs by domain. In some domains the center is message assembly and structure validation, in some it is absorbing results and turning them into assets, and in some the key is observing asynchronous completion.</p>
<p>There was one important principle in this structure. Results made by AI must pass through the same review flow as the editor's existing document state. A structure-preserving transformation must not break its split units, a command-type result must be a structure a machine can apply, and a catalog-based result must lie within the allowed command set. A media result must be an asset the editor can own for the long term, not an expiring external reference. The queue worker is not a proxy that passes the model's response along but a layer that normalizes results to fit the editor's contract.</p>
<h2>Domain executors</h2>
<p>The text-family executor first gathers the signals that have arrived. Then it groups them by path and picks only each path's latest intent as the target to execute. Of the many requests that came in for the same path, only the latest survives, and the rest are closed out as terminated results. This structure handles a user's rapid repeated clicks and consecutive requests naturally.</p>
<p>After choosing the targets, it secures capacity. If it can't get capacity, the latest intent goes back into the queue and only the old requests are closed. Even if it got capacity, failing to get path exclusivity means the same path is already being processed. In that case it returns the capacity and waits again. Only after obtaining exclusivity does it go into execution. This order is the entry condition of a state machine meant to reduce resource leaks and duplicate runs.</p>
<p>Actual message assembly differs by domain. Some tasks apply strong preservation constraints, some transform while keeping structural boundaries, and some raise quality while keeping the original text's style and tone. Some require generation that continues after the existing body text. They may look like similar AI requests on the surface, but the allowed freedom and validation criteria differ.</p>
<p>Command-interpreting tasks take different input from body-generating tasks. If you mix the problem of rewriting body text and the problem of making editable commands from the selected context into the same message, the model confuses the two goals. A visual-extraction task, even though it hangs off the text executor's path, actually has a different validation space. The executor looks at the mode and changes not only the message but also the validation strategy.</p>
<h2>Deterministic gate</h2>
<p>Sending every request to the LLM wasn't good design. Some requests can already be settled by rules. If the sentence a user typed exactly matches an element of the allowed command set, no generative model is needed. At that point a deterministic mapping is enough.</p>
<p>So I put a deterministic gate in front of the generative path. If the input is interpreted as a definite command, the result is produced immediately without calling the model. Even for the same command, if the output contract differs, the shape of the gate's result differs too. What matters is not “what was done” but keeping to the output space the front end expects.</p>
<p>This gate isn't a mere optimization. It reduces cost and latency, but more importantly it handles deterministic behavior deterministically. If you give the freedom of a generative model to an editing command that can be settled, you introduce uncertainty instead. Separating the deterministic path from the generative path, even within an AI feature, keeps the product stable.</p>
<p>The same check could be placed in the front end, but I put the same line of defense on the server too. Even with client bypasses or version differences, definite commands must be handled reliably on the server. Whether it ends at the gate or goes through the model, the cleanup rules are the same. The front end only has to look at how results are received and doesn't need to know which path it ended on internally.</p>
<h2>Structure-preserving validation</h2>
<p>In a structure-preserving transformation, the most important thing was the correspondence of split units. The editor manages the document in fixed units. Even when several units are sent at once, the result must match the original count and order again. If the model merges two units, splits one into two, or skips one in the middle, the editor can't apply the result safely.</p>
<p>So when merging the input array into a single string, I inserted explicit boundary markers. There is a boundary between units, and the instructions repeatedly tell the model to preserve it. When the result comes back, I split it again by the marker and check whether the number of pieces equals the expected count. If it matches, I accept it, and if not, I retry. This isn't a simple string comparison but a process of checking the bijection between input and output.</p>
<p>On retry I reduce the freedom. I state more strongly that the previous output broke the boundaries and how many units are expected. There are times when structural correspondence matters more than natural prose. It's especially so for AI results applied in an editor.</p>
<p>I don't apply the same validation to every task. Tasks where split correspondence is essential, tasks where a single prose output is enough, and tasks that need a structured object each define success differently. Only by separating validation criteria can you cut unnecessary retries and format errors. However well the AI polishes the sentences, if the unit correspondence is broken, it is a failure as an editor feature.</p>
<h2>Typed parse and catalog adherence</h2>
<p>Command-type and extraction-type tasks must not accept natural-language answers. They must return a structure the editor can interpret directly. But generative models often add decoration, put explanations before or after, or make fields that are similar but subtly different. So I put sanitize and parse layers in the worker.</p>
<p>The first step of parsing is to strip the noise and find the candidate object. Then it checks that it is syntactically valid and whether it satisfies the expected shape. If it fails, it isn't accepted and is retried. The retry instruction demands “no explanation, only the agreed structure” more strongly. This is a stretch where format compliance, not writing skill, is the quality criterion.</p>
<p>For catalog-based tasks, I check not only that the JSON is valid but also that the returned command is an element of the allowed set. If it makes up a command that doesn't exist, the editor can't run it. In the problem of turning natural language into commands, quality is measured by catalog adherence.</p>
<p>Some domains have hybrid output. For a writing request the text side may be filled, and for an editing request the command side may be filled. If both are empty, it can still be seen as a valid no-op. In a workspace where one assistant can receive both writing and editing requests, fixing the output space to one side would instead leave it short on expressiveness.</p>
<p>Extraction tasks need schema-specific normalization on top of format validation. If parsing fails, it retries, and for some schemas I even check whether the content is thin even though the format is right. A correct structure and sufficient information are different propositions.</p>
<h2>Candidate selection</h2>
<p>In AI extraction, the last attempt is not always the best. Visual information extraction in particular can have a first result that is quite complete, while a later result has cleaner formatting but misses some of it. So I keep a candidate set, score each attempt on completeness, and preserve the more complete result.</p>
<p>If under-extraction is suspected, the retry instruction changes too. Instead of just “return a valid structure,” it gives a completeness hint to fill in the missed areas. A retry caused by a format error and a retry caused by thin content are different problems. Even for the same retry, if the reason differs, the instruction must differ.</p>
<p>Even if the last attempt failed or came out worse, if an earlier, more complete candidate exists, I keep it. A partially usable result is better than a complete failure, and an earlier attempt may hold more information. This judgment is made by the worker, not the model. The worker is not a place that merely takes down the response but an execution layer that compares and adopts candidates.</p>
<p>The user sees just one request, but inside the server, multiple attempts, validations and candidate preservation take place. Broken responses are discarded, under-extraction is retried, and the most complete result is kept. The difference is greater the more directly omissions show to the user. In the end, the extraction worker became not a model-calling stub but an extraction pipeline that runs through observation, validation and selection.</p>
<h2>Media materialization</h2>
<p>Image and video workers are more I/O-heavy than text workers. They validate the generation request, claim capacity and exclusivity, and then call the external generator. When they get a result reference in the response, they don't use it as is. An external provider's reference can expire and is unstable as a document asset in a publishing editor. So I absorb it immediately and turn it into a static asset the product owns.</p>
<p>Options are normalized on the server too. Values beyond the allowed range are clamped, unspecified values follow the default policy, and a value the user deliberately left blank is distinguished from one that was never sent. Small differences like these build trust between the UI options and the actual generation results.</p>
<p>Editing-type media tasks require an input asset. If a required input is missing, they end with an empty result. If needed, the input's structure is compressed and attached to the generation context. Information like colors, shapes, text regions and coordinates becomes a signal that raises the accuracy of the edit request. Size limits and cleanup of temporary resources are handled along the way.</p>
<p>Video generation and video editing have longer flows. If the required media is missing, they don't start. Because bad input that reaches the external call wastes cost and time, cutting it at the worker's entrance is right.</p>
<p>What matters in the media worker is ownership of the result reference. If you put an external temporary link into the document as is, the asset may vanish when the book is reopened or sent out later. Every generated result is absorbed into the product's own storage. The editor receives not a provider URL but a static reference managed by Opkle.</p>
<h2>Asynchronous observation</h2>
<p>A video task doesn't produce a result immediately. You first have to create the job and receive an observable job identifier. If there is no identifier or the creation itself fails, it ends right there. Once the job is created, the worker observes its status at regular intervals.</p>
<p>The status falls into broadly waiting, in progress, succeeded, failed, cancelled and unknown. Waiting and in progress keep waiting, and on success it gets the result reference and ends the loop. Failed, cancelled and unknown close out with an empty result. If a transient network error occurs during observation, it isn't immediately treated as a total failure. A communication error and a task failure are different events.</p>
<p>I also set the observation interval and the maximum wait time clearly. The capacity a long task occupies must be separated from the capacity of tasks that finish quickly. Just because a video takes long, sentence transformations and short command interpretation must not be blocked along with it. It's the same principle as keeping a long-service-time class from eroding a short class in a multi-class queue.</p>
<p>Even after the result reference arrives, the task isn't over. The worker reads its content and absorbs it as a product asset. Since videos can be large, I leave generous transfer and time limits. The final result is not an external link but an asset reference managed by Opkle Editor.</p>
<p>Once this structure is in place, video tasks also enter the editor's general asset-handling flow. The user waits through a long task, but when the result arrives it isn't a mere external link but an asset the product owns. After that, whether it is played in the preview or bundled into a book, it can be handled reliably.</p>
<h2>Resource release invariants</h2>
<p>One of the things I considered most important in the queue server was the cleanup path. AI tasks can fail. The external call can fail, structure validation can fail, asset absorption can fail. But if capacity or path exclusivity remains after a failure, the next request gets blocked. So I wrapped the execution part so that it always has a release section regardless of success or failure.</p>
<p>When a task ends, regardless of success, it clears the in-flight registration, releases path exclusivity, returns the capacity and releases the path lock too. This order repeats in every executor. Even if the work differs, the termination invariant must be the same. That way it's clear where to look in a failure situation.</p>
<p>An empty result is a result too. If the input is empty, a required asset is missing, nothing was generated, or absorption fails, it sends an empty termination state. What matters is that the client doesn't keep waiting. Even if it failed, the user must receive a completed state.</p>
<p>The real-time result store has a lifetime. It guarantees time for the UI to pick results up, but keeps results from piling up endlessly in the runtime state. Long-term records are the job of a separate log layer. Only by separating fast execution state from slow history can each focus on its own role.</p>
<p>Cases where only a signal remains and no real latest intent exists are also targets of cleanup. It doesn't touch identifiers that have already claimed capacity and are in progress, and closes only old requests that are no longer valid. The principle was never to leave a pending state unattended in any case.</p>
<h2>Control loop</h2>
<p>The final worker loop is a simple structure that keeps spinning. In one tick it calls each task domain's executor in order. Each executor empties its own queue, groups by path, picks the latest intent, claims capacity and the lock, and then runs the actual work asynchronously. The loop itself doesn't do too much and only executes each executor's policy.</p>
<p>I keep the loop's rest interval short. If it's too long, the start delay grows when a user presses AI. The sweep that reclaims stale leases, however, isn't run every tick but at a fixed period. The ordinary loop stays light, and old registrations and locks are cleaned up periodically.</p>
<p>I also run one sweep when the worker starts. That's because there may be in-flight traces left by a previous process that terminated abnormally. Tasks still in the queue can simply be processed again, but if stale registry entries remain, paths can be blocked. The startup sweep is the initial cleanup to go in with a clean state.</p>
<p>Shutdown signals are handled too. When a signal arrives, no new loop starts, and asynchronous tasks already running are cleaned up through their own release path. Restart safety is tied to the in-flight set. If there are no tasks in progress, it can safely restart, and if there are, it can wait. Tasks not yet picked up remain in the queue, so they are not subject to loss.</p>
<p>By this stage the queue server was no longer a simple background process but AI runtime infrastructure. Per-path latest intent, capacity and locks, in-flight registration, retry validation, asset absorption, asynchronous observation, result lifetime, history records, stale sweep and graceful shutdown were all connected into one. In repeated tests, structure preservation, format validation and retry, the deterministic gate, latest-intent priority, termination of old requests, observation of long tasks, asset conversion, restart safety and the cleanup path all passed reliably. Opkle Editor's AI features now run not on a model call but on a worker system that can hold up continuously in a production environment.</p>]]></description>
      <category>dev</category>
      <pubDate>Tue, 30 Jun 2026 02:30:10 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: Absorbing Video with CSS Animation</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-5?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-5?lang=en</guid>
      <description><![CDATA[<p>After confirming that the media query support rendered reliably even in retailer e-readers, my confidence in EPUB3 grew clearer. EPUB is not just a file that reflows text; it is a format that can bring the expressive power of HTML and CSS into a book. Watching mobile, tablet and desktop together with light and dark modes, and seeing images and tables change naturally to fit each condition, I knew exactly which area to try next: CSS animation.</p>
<p>CSS can do far more than media queries. Combine features like <code>transition</code>, <code>animation</code>, <code>transform</code>, <code>opacity</code>, <code>filter</code> and <code>@keyframes</code>, and you can make everything from simple entrance effects to layer-by-layer motion, repeated playback and scene transitions. On the ordinary web these are very familiar, but letting creators handle them directly inside an EPUB had a completely different meaning. If you can create motion inside an ebook and it plays back unchanged in retailer e-readers, EPUB can become a much broader expressive medium.</p>
<p>So the next implementation was a GUI animation generator. The idea was that users, without writing any CSS, pick a layer and adjust values such as time, delay, repeat, opacity, position, size and rotation, and the editor generates the CSS animation and keyframes. The preview target and document state structure I had built for media query support carried over here unchanged. An animation is an effect you see on screen, but inside the EPUB it still had to be serialized reliably into CSS strings, resources and XHTML structure.</p>
<h2>Blocks, Layers and Animation</h2>
<p>From the start I had no intention of making animation a CSS code input feature. If users had to write <code>@keyframes</code> themselves and hand-tune <code>animation-duration</code> or <code>animation-delay</code>, we'd be back to a code editor. What I wanted was for users to select a layer on screen and decide through a GUI when and how it moves, with the editor generating the CSS.</p>
<p>So I took the block and the layer as the basic unit of animation. There are elements such as image blocks, text blocks, group blocks and overlay blocks, and each element can have an animation state. The animation state holds properties such as duration, delay, easing, iteration count, fill mode, transform values, opacity values and start/end positions. Users change values in a panel, but internally that state is serialized into CSS keyframes and animation rules.</p>
<p>This fit well with the document state structure I had already built. The XHTML keeps the semantic structure of elements, while CSS handles presentation and motion. The Shadow DOM preview renders the current state, and the CSS string in CodeMirror 6 preserves the generated animation rules. IndexedDB saves the block state and CSS state together. When a user adjusts the timing in the GUI, the motion in the preview changes right away and the CSS string is updated at the same time.</p>
<p>What mattered in building per-layer animation was independence and composition. To make a scene where one image fades in slowly, another piece of text rises up 0.3 seconds later, and the background layer gently zooms, each layer needs its own animation state. At the same time, the whole scene has to move like a single timeline. So I managed individual layer state and scene-level timing separately.</p>
<h2>A CSS Animation GUI</h2>
<p>The most important principle in building the animation GUI was not to hide the CSS but to generate accurate CSS. Creators adjust motion with a timeline, sliders, toggles and easing choices, but the result is, in the end, the CSS that goes into the EPUB. So any value made in the GUI had to be reproducible at any time as <code>@keyframes</code> and class rules.</p>
<p>For example, when a user sets a fade-in and translateY on an image layer, the internal state isn't stored as a mere string saying “fade in.” It is preserved as values like <code>opacity: 0</code> and <code>transform: translateY(...)</code> in the start frame and <code>opacity: 1</code> and <code>transform: translateY(0)</code> in the end frame. The CSS serializer then builds a keyframes name from those values and gives that block an animation class.</p>
<p>Keyframes names also had to be managed. An EPUB contains many chapters and many blocks, and keyframes with the same name must not collide. So I generated unique keyframes names based on the block id or animation id and created the CSS rules from those. When a layer is deleted or an animation changes, the unused rules have to be cleaned up too. Otherwise the CSS keeps growing, and dead keyframes are left inside the exported EPUB.</p>
<p>With this structure in place, the distance between the GUI and the CSS disappeared. Users adjust animation visually, while the editor is internally building precise CSS animation rules. Because the motion seen in the preview and the motion inside the exported EPUB come from the same rules, the gap between the editor and the output also shrank.</p>
<h2>Getting Past the Limits of the video Tag in EPUB</h2>
<p>Making animations naturally led to the problem of video. EPUB3 supports the video tag. By the spec, it is possible to put video in an ebook and play it. But in real retailer e-readers and reading systems, video playback is often unreliable. Some readers show different playback controls, in some environments it doesn't play at all, and file size and codec conditions can cause trouble.</p>
<p>So I didn't go the route of simply trusting the video tag. What EPUB still guaranteed reliably was images and CSS. Image resources are handled reliably by most reading systems, and CSS animation, even with its limits, was often more predictable than video. So the thought came naturally: what if I turned the video into an image sequence and played those images back with CSS animation?</p>
<p>Conceptually this is simple. When the user adds an mp4, the server extracts frames with ffmpeg. The extracted frames become a JPEG image sequence. The editor bundles those frames into a single animation component and shows them in order using CSS keyframes or a step animation. As a result, the EPUB contains not a video tag but many images and a CSS animation rule.</p>
<p>The key was to make the playback feel smooth enough. If you include every frame no matter what, the file size balloons. If you cut frames too much, the motion looks choppy. So I had to tune together the original video's length, the target fps, the number of images a reader can handle, the JPEG compression quality and the image size per viewport. This was a video-processing problem and an EPUB packaging problem at once.</p>
<h2>Turning an MP4 into a Frame Sequence</h2>
<p>On the server side I used ffmpeg. When a user uploads or drops an mp4, the server receives the file and breaks it down frame by frame. The output can be made into an image sequence like <code>frame_0001.jpg</code> and <code>frame_0002.jpg</code>, with resolution and quality adjusted as needed. Since these are resources that go into an EPUB, rather than keeping the original resolution, it mattered to shrink them to a size suited to the actual preview targets and reading environments.</p>
<p>Once the frame sequence is made, the editor doesn't treat it as an ordinary bundle of images but registers it as the resource set of an animation component. Each frame has to go into the OPF manifest, with the media-type set to image/jpeg. The resource store keeps metadata such as the frame list and order, duration, fps and target size. This component state also has to be saved in IndexedDB so the same animation can be restored when the project is reopened later.</p>
<p>There are several possible ways to play it back in CSS. One is to switch the background-image step by step in keyframes, and another is to lay the frame images out like a sprite and move the background-position. In an EPUB environment you have to account for differences in CSS support among reading systems, so I had to go with the approach that renders most reliably. What mattered was that the result wouldn't depend on video decoding and would move through image loading and CSS animation alone.</p>
<p>With this structure, video was no longer tied to the video tag. The user adds an mp4, but inside the editor it is converted into an EPUB-friendly image animation. Even if video is unstable in retailer e-readers, an animation made of images and CSS could play back far more reliably.</p>
<h2>Image-Sequence Video</h2>
<p>The advantage of the image-sequence approach was that it fit the image component structure I had already built. Since in Part 4 I was already handling image variants as components, the frame sequence could go into the same resource management scheme. The difference was that it wasn't a single image variant but a bundle of images with a time order.</p>
<p>The animation component holds a frame list, and the CSS state decides at what time interval that frame list is shown. The preview target renders the frame size and presentation that match the current viewport and theme conditions. On export, all the frame images go into the EPUB package and are registered in the OPF manifest without omission. The body XHTML gets a structure representing the animation component, and the CSS gets the playback rules.</p>
<p>This approach could also be combined with media queries. On mobile it can use a smaller frame sequence, and on desktop a larger one. Using frames with a different color feel in dark mode is also structurally possible. In the end even video could be handled as an extension of the image variant component. It suited the actual reading environment of EPUB better than putting in a single mp4 as is.</p>
<p>Of course, as the number of resources grows, you have to manage package size and loading timing. So I managed frame count, compression rate, preload behavior, animation duration and repeat behavior together inside the component state. In the editor preview you can check the feel of real playback, and in the pre-export review you can check for missing manifest entries, path errors, missing CSS rules and frame order errors.</p>
<h2>CSS Animation as a Core Feature of EPUB Expression</h2>
<p>After this implementation, CSS animation was no longer a mere decorative feature. It became the key technology for expressing motion safely inside an EPUB. Scenes where text appears slowly, where images move layer by layer, and where a short video plays as an image sequence all came in through the CSS animation structure.</p>
<p>Inside the editor, users adjust layers and timing directly. Internally, the animation state changes, the CSS serializer generates keyframes and class rules, and the Shadow DOM preview shows the result immediately. The generated CSS string is reflected in CodeMirror 6, and IndexedDB saves the state and resources. This flow ran naturally on top of the synchronization, media query and resource management structures built in Parts 3 and 4.</p>
<p>Converting an mp4 into a frame sequence in particular made the direction of Opkle Editor clearer. Users add a video, but what goes into the EPUB is images and CSS that retailer e-readers can handle reliably. It looks like video on the outside, but internally it is an EPUB-friendly animation package. This approach let expression survive even in environments where video tag support is patchy.</p>
<p>The result was a clear success. The GUI animation generator produced per-layer CSS animation reliably, and the generated keyframes and animation rules behaved consistently across the preview and the exported result. The flow of converting an mp4 into a JPEG frame sequence with ffmpeg and playing it as a CSS animation also passed retailer e-reader review without a hitch. At this stage Opkle Editor evolved beyond images and tables into an editor that can absorb motion and video into EPUB3.</p>]]></description>
      <category>dev</category>
      <pubDate>Mon, 29 Jun 2026 05:43:57 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: Designing an LLM for Making Books</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-6?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-6?lang=en</guid>
      <description><![CDATA[<p>With media queries, image variants, CSS animation and even image-sequence video in place, Opkle Editor was moving beyond a simple EPUB production tool toward a multimedia publishing environment. Once paragraphs, images, tables, animation and video can all be handled inside one EPUB, creators have more decisions to make. Which voice to keep, how to connect the flow of scenes, at what density images and sentences should meet, whether the tone of the whole book holds steady to the end: they have to keep judging all of it.</p>
<p>At this point I felt an AI helper was absolutely necessary. But bolting an ordinary chatbot next to the editor wasn't enough. An LLM for making books can't answer by looking only at one selected paragraph. It has to understand the whole chapter, the rhythm of the previous chapter, setups that will pay off later, genre-specific style, expressions the author has banned, the target readership and the full synopsis. So the AI feature couldn't be a simple API call; it had to be a separate system that projects the editor's document state into inference input.</p>
<p>The criteria were clear from the start. It had to handle long contexts reliably and keep the flow of a long Korean manuscript. The model's range of operation had to be pinned down by genre, style, theme, worldbuilding, prohibitions, output format and editing standards. On top of that, it needed training data and evaluation data. The LLM going into Opkle Editor had to be not a sentence generator but a long-form editing engine that maintains a book's structure, style and world.</p>
<h2>Long-context capacity</h2>
<p>A book is hard to handle with short inputs and short outputs. The style of one chapter connects to the rhythm of the previous one, and sentences in the second half must pick up the setups from the first. In informational writing, terms and standards set early have to hold later, and in fiction, characters' speech, their relationships and the rules of the world must stay alive throughout. So the first thing I looked at among the model conditions was the context window.</p>
<p>That is why I made long-context capacity a criterion. A model that answers by looking at only part of a manuscript can produce sentences quickly, but it's hard for it to take responsibility for the whole book. If it can't remember which expressions were avoided earlier, which concepts were already explained and how each character has been speaking, the results wobble. Inside the editor, the selected passage, the surrounding context, chapter-level information, a compressed book summary, style criteria and the task instructions all had to fit in at once.</p>
<p>What mattered here wasn't simply pushing a long string into the model. It was a question of how to arrange information within a finite context budget. In information-theoretic terms, what the model actually uses is not the whole input but the part where attention stays alive. The selected passage goes in with the highest priority, nearby context goes in as local information, and the chapter and book summaries go in as compressed representations. Fixed instructions sit in their own section, and if needed, part of the trace of recent edits is attached.</p>
<p>So an AI call became not a single line of prompt but an assembly of information bundles with different roles. The inference layer arranges these bundles in an order the model can understand reliably. A long context is not performance in itself; it turns into editing accuracy only when it is packed well. Even with large capacity, if the arrangement is poor, attention easily blurs.</p>
<h2>Constraint layers</h2>
<p>To use an LLM for book production, the structure of the instructions matters. A generic “fix it so it reads naturally” isn't enough. What genre it is, what the style is like, how much explanation the reader may be given, whether the prose should be dry or lyrical, and which expressions must never be used all have to be injected into the model continuously.</p>
<p>I didn't see the system prompt as just one long sentence. I saw it as constraint layers that partition the set of things the model is allowed to do: the basic role, genre rules, style conditions, worldbuilding and forbidden developments, and the purpose of the current task. Each layer applies a constraint along a different axis, and combined they form the feasible region in which the model can move.</p>
<p>Dividing it this way makes assembly stable. A novel and a technical document can share the same basic role, with only the genre, style and worldbuilding layers swapped. In an essay it keeps the writer's distance and voice, in informational writing it prioritizes evidence and consistent terminology, and in fiction it prioritizes character speech and scene continuity. It's not replacing the whole set of constraints at once, but swapping them axis by axis.</p>
<p>The system prompt was not a shackle binding the model but a device for setting the boundaries of inference. It is the standard that keeps the model from arbitrarily changing genre, suddenly sounding like advertising copy, or inventing settings outside the world. Because this constraint layer goes in every time AI is called inside the editor, users get not a simple chatbot but an editing engine that understands the rules of their own book.</p>
<h2>Supervised editorial mapping</h2>
<p>To build a model tailored to book production, the training data also had to be different. General question-answering or short-form writing data alone isn't enough. The model had to learn why a good book is good, which style suits which genre, which structure carries a reader to the very end, which sentences are excessive and which omissions are effective.</p>
<p>So I gathered well-written books and analyzed why they are well regarded. I didn't simply collect sentences; I looked separately at chapter composition, openings, sentence rhythm, scene transitions, characters' speech, repetition and variation of themes, density of explanation and reader experience. A good book isn't made by chance from a few good sentences; it is the result of structure, style and reader experience fitting together consistently.</p>
<p>This analysis had to be turned into supervised samples. A single sample needs to contain together what is being asked, what is being looked at to make the fix, which book context is seen alongside, what the desirable result is, and why it was fixed that way. That's because editing isn't a plain copy from input to output but a mapping that includes judgment. If there is only the revised text and no rationale, the model easily mimics only the surface tone.</p>
<p>Quality matters most, but quantity matters too. If Korean long-form writing data is narrow, the model easily tilts toward a particular style, or makes every text into similarly flat sentences. So I had to accumulate enough samples that differ in genre, readership, intensity of style, narrative distance, information density and proportion of dialogue. If the distribution is narrow, the learned function is stable only in a narrow region. Only with this data does the direction of “an LLM for making books” come down into an actual training signal.</p>
<h2>Feature space of good writing</h2>
<p>What mattered in the training data wasn't only explanations that read well to people. I needed a representation that the model and the pipeline could use repeatedly with the same standard. So I didn't leave the analysis results as free-form notes but organized them into consistent structured signals. If evaluation criteria are written differently for every book, it wobbles when converting into training samples, and comparison becomes hard when building an evaluation set later.</p>
<p>The core of the structuring was separating meta information describing a work from style, structure, reader experience and editing judgments. Genre and readership, tone, narrative distance, sentence rhythm, vocabulary density, compositional patterns, scene transitions, character voices, world rules, strength of editing and patterns to avoid. Unless these axes are kept from blending into one lump of impressionistic review, it's impossible to trace what the model learned.</p>
<p>This representation was for training and inference at once. A style profile for a particular genre can be put into the constraint layer, and when a user wants to take some book's tone as a reference, that profile can be put in as a context asset. From the same structure I can build fine-tuning samples, evaluation prompts and the real-time AI input inside the editor. One analysis becomes a common coordinate system for several stages.</p>
<p>Unifying the data structure makes model development sturdier. You can check quality, find omissions per axis, and see whether the data is skewed toward a particular genre or style. It was the work of turning a sense of good writing from something left only as criticism people read into measurable features the model can read.</p>
<h2>Korean long-form model</h2>
<p>For an LLM for books, understanding long-form Korean was a separate criterion. Many models generate short sentences plausibly. But taking in a long manuscript, keeping the context before and after, holding genre and style steady, and even considering the reader's flow of understanding is on a completely different level. In Korean, the nuance at the end of a sentence, formal and informal speech levels, narrative distance, emotional restraint and the length of breath greatly change the quality of the result.</p>
<p>So in choosing a model I also prioritized long context and Korean comprehension. Even when given a long input it must not lose the setups from the beginning, and it must understand the role of a paragraph rather than just polishing the surface of sentences. In fiction it has to keep characters' speech and the temperature of scenes, in informational writing the flow of terms and evidence, and in essays the writer's distance and voice. Each kind of writing has different invariants to preserve.</p>
<p>On top of the base model, editing training signals and style instructions had to be layered. The base model handles long Korean reliably, and adjustments for the book-production task are added on top. Add the constraint layers and context packing, and the model isn't simply generating sentences; it is handling a selected passage within the structure of the entire book.</p>
<p>Evaluation also mattered in this structure. It isn't enough just to see whether the output reads naturally. The evaluation set has to be built from items like keeping genre, keeping style, keeping the world, reflecting context before and after, avoiding banned expressions, suppressing exaggerated generation and preserving Korean breathing rhythm. Model development doesn't end at training; it had to be measured repeatedly on whether it works reliably on real book-editing tasks.</p>
<h2>State projection</h2>
<p>For the AI helper to work properly, it has to be connected to the editor's document state. It needs to know which paragraph the user selected, which chapter that paragraph belongs to, what is around it, and what the genre and style criteria of the current book are. So an AI request became not a plain sentence but a context package built by pulling just the necessary coordinates from the document state.</p>
<p>The context builder's job isn't to copy the entire document as is but to project onto the subspace needed for this task: the original text of the selected passage, its chapter, close neighbors, compressed summaries of the chapter and the book, the style profile, the constraint layers, the purpose of this task and the expected output form. In a multimedia EPUB, descriptions of images, tables and animated sections can also be context, because text is not the only information.</p>
<p>Responses are also more stable if the change proposal and its application are separated, rather than overwriting the body directly. The model's output should keep “what to change,” “why that was judged,” and “what range will be touched” separate. Only when the user applies it are the document state and saved state updated together. AI editing too has to enter the existing document state and serialization flow.</p>
<p>Once this structure is in place, AI is not an external tool but an internal feature of the editor. Polishing sentences, suggesting structure, matching style, writing chapter summaries and checking overall consistency all run on the same document model. The LLM isn't a separate chat window but an inference layer that understands the selected state of the book.</p>
<h2>Inference as composition</h2>
<p>What was finally needed was an inference pipeline connecting the model, the data, the constraints and the editor state into one. When the user presses an AI feature, the editor reads the selection state, the context builder assembles the input, the constraint layers are attached, and the model returns a response in the agreed form. That response must be not text that straight away overwrites the screen but a transformation that can be applied to the document.</p>
<p>This transformation then goes back into Opkle Editor's existing structure. When the selected passage changes, the document state is updated, and the saved document representation and the editor state change together. If needed, the preview is redrawn too. Results made by AI have to pass through the same saving and review flow as results edited by hand. That way the AI feature doesn't become a special exception inside the editor.</p>
<p>As a result the structure was clearly completed. A model that handles long-form Korean, constraint layers that fix the rules of the book, training signals that split good writing into axes, evaluation criteria, projection of document state, structured output, and the flow of applying a document patch all meshed into one. The AI helper became not an independent sentence-generation feature but a layer of the book-production workflow.</p>
<p>This stage also came together successfully. Long manuscript context, genre and style constraints, structured analysis data, the cycle of training and evaluation, and integration with the editor's document state were connected into a single LLM system. Opkle Editor was now a tool for making multimedia EPUBs and at the same time had grown into an AI editing environment that manages a book's sentences, structure and worldbuilding together.</p>]]></description>
      <category>dev</category>
      <pubDate>Mon, 29 Jun 2026 05:43:57 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: Where Writers Stop at EPUB</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-1?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-1?lang=en</guid>
      <description><![CDATA[<p>I didn't start building Opkle Editor out of some grand market analysis. I had worked as a full-stack developer at an IT platform company and then an AI company before striking out on my own, and all along I was also someone who writes and makes books. I have published two books myself, and I have taken part in a number of book fairs, where I met the people who make books up close. One scene from those fairs stayed with me for an odd length of time. Creators weren't struggling because they couldn't write. They already had their stories, and they were already thinking about covers, sentences and readers. Yet they often stalled at <strong>the moment of turning that manuscript into an ebook</strong>.</p>
<p>At first it puzzled me. As a developer, EPUB was not an unfamiliar format. If you know HTML and CSS you can understand the structure, and anyone who has worked with web documents can see why the text reflows, why a table of contents appears, and why styles are kept separate. But to the authors I met at book fairs, EPUB was less a free publishing format than a “difficult, complicated file that throws errors.” That gap kept nagging at me.</p>
<p>EPUB is not an expressively weak format by nature. It is built on HTML and CSS, the same roots as web documents. It can reflow to fit the screen size and the reader's settings, and it can carry links, images, fonts and even accessibility information. Forms of expression that differ from print are entirely possible. In actual production, though, those possibilities were hard to see. What creators ran into first was not possibility but tags, folders, CSS and validation errors.</p>
<h2>What I Heard at Book Fairs</h2>
<p>At a book fair you meet the people who made books from very close up. Someone has bound a season of their life into a book, someone has woven drawings and photographs into a small publication, someone has turned sentences they held onto for years into a single physical object. For them a book is not simply a product. It is the way a thought they have carried for a long time travels over to the reader.</p>
<p>But even when they had managed to make a print book or a PDF somehow, the mood often changed once EPUB ebooks came up. I kept hearing things like “I'd like to make an ebook too, but it's too hard,” “I don't know where to start,” and “They say validation shows errors, but I don't understand what that means.” People with enough content of their own to make a book became beginners again, standing in front of an unfamiliar technology.</p>
<p>The more I listened, the stranger it felt. EPUB is a format that could open up more possibilities for creators, yet to creators it was arriving as a new burden rather than a new freedom. The ability to make a book and the ability to handle code were bound together far too tightly. It was a structure that suddenly demanded HTML, CSS, packaging and validation from people who write, choose images and imagine how readers will move through a text.</p>
<h2>The Distance I Felt Looking at Sigil</h2>
<p>There were, and still are, widely used tools for making EPUBs. Sigil is the best known of them. It is undeniably an important tool, and it lets you open and edit EPUB files directly. For someone who knows HTML and CSS it is powerful. The problem was that many of the creators I met at book fairs found it hard to make their own books that way.</p>
<p>To my eyes, Sigil often looked like “a code editor for handling the EPUB folder structure.” If you want to fix a heading you have to look at tags, if you want to adjust a margin you have to know CSS, and to check whether the file is valid you have to go through yet another validation tool. That may be a natural procedure for a developer, but for an author it meant the flow of making a book kept being interrupted.</p>
<p>Error checking was especially like this. W3C validation and accessibility checks are essential for the quality of an ebook. For an EPUB to be distributed, to open reliably in many readers and to reach more people, these steps are unavoidable. But the sentence “there are errors” alone gives a creator nothing to move forward with. What is wrong and why, how to fix it, and what that fix means for the book's reading experience all had to be connected.</p>
<p>From then on I came to think that the tooling problem was not simply a matter of having more or fewer features. Creators are not people who want to avoid technology. They are people who want to meet the technology their book needs in the language of their own work. EPUB tools, though, still felt like they were looking at creators from the developer's seat.</p>
<h2>Easy in Code, Hard in Practice</h2>
<p>As a developer, understanding the structure of EPUB was relatively clear-cut. There are set files inside a compressed archive, the body text is made of HTML, and styles are organized in CSS. There is a table of contents and metadata, and images and fonts go in alongside. Technically, that is how you can sum it up.</p>
<p>A creator's work doesn't organize itself that way. Authors make books out of feelings like “I'd like this paragraph to look a little quieter,” “I'd like this image to breathe between the lines,” “I'd like readers to turn this scene slowly.” A developer translates that into tags and styles, but there is no reason an author should have to think that way from the start.</p>
<p>That difference loomed larger and larger for me. It wasn't enough for a tool that makes EPUBs simply to show the file structure well. The process of seeing, touching, fixing and checking their own book had to feel natural to the creator. If making ebooks stayed purely a coding task, EPUB would remain a format that only some people could handle properly.</p>
<p>That was when a question took shape in my mind. Without knowing HTML and CSS, could creators work directly on the structure and design of their own books? Could error and accessibility checks be brought inside the process of finishing a book, instead of being a separate, frightening procedure? Could making an ebook become a creator's workflow rather than a developer's task?</p>
<h2>The Moment I Decided to Build an Editor</h2>
<p>What I wanted to build was not just a program that saves EPUB files more easily. I wanted an editor where creators can directly handle the structure and design of their own books, understand what a result means without knowing HTML or CSS, and check errors and accessibility problems within the flow of their work. I didn't want to force creators to learn a code editor. I needed a tool that lets them work with EPUB in a creator's own language.</p>
<p>My first resolve was simple: I hoped every author could express themselves through EPUB. By “every author” I don't mean that everyone should make books in the same way. Quite the opposite. I meant that text-centered books, image-heavy books, books that need movement, books that sit somewhere between teaching material and literature, every kind of content should be able to come alive in an ebook in its own way.</p>
<p>Good software isn't finished just by packing in features. You have to know at what moments users get stuck, what they fear, and which decisions they want to make themselves. For an EPUB editor, that meant asking not only “is the file valid?” but also “does this book read the way its creator intended?”</p>
<p>That is how the development of Opkle Editor began. It didn't begin as a repackaging of existing technology, but as a way to reduce, one by one, the blockages creators actually hit when making books. The first goal was not some sweeping automation. It was to keep authors from stopping in front of their own books because of technology, and to bring the expressive freedom EPUB holds a little closer to creators' hands. That was why I decided to build this editor.</p>]]></description>
      <category>dev</category>
      <pubDate>Sun, 28 Jun 2026 08:21:35 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: The First Build Was a Code Editor</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-2?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-2?lang=en</guid>
      <description><![CDATA[<p>Once I had decided to build an EPUB editor, I went straight into implementation. Looking back, my reasoning at the time was quite linear. An EPUB is ultimately a compressed bundle of web documents: XHTML for the body, CSS for styles, and package information in an OPF file plus an NCX or nav document. So if a web developer were building an EPUB editor, it seemed most natural to build on TypeScript and Node.js and to control the file tree, packaging, code editing, preview and storage structure directly.</p>
<p>I set up the first project as a Node.js + TypeScript structure. On the server side, an EPUB project was treated like a single working directory, and on the front end each XHTML and CSS resource could be opened as its own editing unit. At the center of the editor I plugged in CodeMirror 6. CM6 has a good extension architecture, and its language packages and transaction/update listeners let me detect input state in fine detail, so I could build a far more stable code-editing experience than a plain textarea would allow.</p>
<p>What I was really building then was closer to “a web-based EPUB IDE more automated than Sigil.” I turned the EPUB's <code>META-INF/container.xml</code>, <code>OEBPS/content.opf</code>, body XHTML, CSS, images and font resources into a project tree, and every time a file was opened I created a CodeMirror instance matching that resource. When the user typed in the body, an update listener detected the change, reflected it in the internal state, and, where needed, re-tidied the HTML fragment. Looking back now, that first build was less an editor for creators than a developer tool for handling EPUB packages.</p>
<h2>Treating the EPUB Project Like a File System First</h2>
<p>At first I looked at EPUB from the package structure rather than from the creator's screen. Creating a new book generated a default folder tree, and the OPF file got its metadata, manifest and spine set up. Adding a body file meant putting an XHTML item in the manifest and reflecting its reading order in the spine. CSS files were registered as separate resources and linked from the body XHTML with a link tag.</p>
<p>As a developer, this approach was clear. An EPUB is a bundle of files governed by rules that a reading system has to follow, so the editor only has to manage those rules consistently. A file can't be missing from the manifest, body text not in the spine disappears from the reading order, and images or fonts not registered in the OPF become orphan resources inside the package. So in the first build I tried to tie the project tree and the OPF state together tightly.</p>
<p>Even adding a single file wasn't just a matter of adding an entry to a UI list. Internally the resource path, media-type, manifest id, whether it belongs in the spine, and the relative paths referenced from the body text all had to line up. In particular, since the internal paths must survive after the EPUB is zipped up, I needed to manage the names shown on the front end separately from the real package paths.</p>
<p>At the time I thought that if the editor handled this structure well automatically, users would be much better off. They wouldn't have to build the folder tree themselves or edit the OPF by hand, and adding a resource would update the manifest on its own. But that judgment rested on a premise: that users would at least accept the fact that “an EPUB is a bundle of these files” and get used to a way of working that involves editing those files.</p>
<h2>CodeMirror 6 and HTML Editing</h2>
<p>I built body editing around CodeMirror 6. Every XHTML file got its own CM6 EditorView, and the document state was managed with EditorState. When input arrived, the update listener received the transaction, checked whether anything had changed, and reflected the changed string in the internal document model. At save time, that string was serialized back into the XHTML file's contents.</p>
<p>From the beginning I wanted to spare users from writing HTML entirely by hand. For example, if they typed plain text, it would be wrapped in <code>&lt;p&gt;</code> tags paragraph by paragraph, and if they selected an area and double-clicked or right-clicked, they could rename the tag or add attributes. I also imagined a flow where a class is attached to the selected area and then linked, as a selector, from the CSS side. It was a layer of creator-facing controls laid over a code editor.</p>
<p>Technically it was rather fun work. I had to read the selection range in CM6, track which tag in the HTML string that range sat inside, and when the tagName or an attribute was changed from the context menu, modify the original string. This wasn't plain text editing. I had to keep the HTML structure inside the string and the user's selection in sync at all times. Get it wrong and the cursor position drifts, tags break, and the undo stack and internal state fall out of step.</p>
<p>Working on that problem, I spent quite a lot of time on “a code editor that shows less code.” I made it so users didn't have to type <code>&lt;div class="..."&gt;</code> themselves, added an attribute-editing UI, and let them change tags from the right-click menu. But the core structure was still an HTML string. In the end, users had to work inside the world of tags and attributes, classes and selectors.</p>
<h2>Resource Drops and Automatic OPF Manifest Updates</h2>
<p>Images and fonts were a frequent sticking point in EPUB production. Putting a file in the project isn't the end of it. You have to add an item to the OPF manifest, get the media-type right, and make the paths referenced from the body text or CSS stable. For fonts, that can extend to the CSS <code>@font-face</code>, and images can be referenced from an XHTML <code>img src</code> or a CSS background.</p>
<p>So I attached drag and drop events to the CodeMirror 6 area. When a user dragged in an image or font file, I added it to the internal resource store and generated an OPF manifest item based on the file extension and MIME type. If the same name already existed, I regenerated the path to avoid a collision, and when the file was dropped onto the body editor, I inserted an <code>img</code> tag or reference code at that position.</p>
<p>By my standards at the time, this feature was a real step forward. Missing resources are a common error in EPUB packages, and when the manifest and the actual file list diverge, it becomes a problem at the distribution stage. If the editor took the drop event and handled resource registration and reference insertion in one go, users could avoid opening the OPF themselves.</p>
<p>But the same limitation lurked here too. As a developer I attached great meaning to “the manifest updates automatically,” but users didn't know what a manifest was. What they wanted was “I want to put this image here,” not “I want to register this resource in the manifest and reference it from the XHTML.” What I had automated was EPUB's internal rules, while the unit of work users felt was still the scenes and paragraphs of the book.</p>
<h2>Saving to IndexedDB</h2>
<p>I took the storage architecture seriously from the start. In a web-based editor, losing a manuscript is fatal. Book work in particular isn't something finished in one sitting; it goes on for days, weeks, months. A storage design that depends only on the server can be affected by network conditions, login state and server outages, and there was also the burden of always sending a manuscript off to an external place.</p>
<p>So I made active use of the browser's IndexedDB. I designed it so that, per project, the body XHTML, CSS, images, fonts, OPF metadata and working state were saved locally, and during editing only the changed resources were updated. localStorage fell short on capacity and structure, and IndexedDB was a better fit for handling files, large strings and blobs together.</p>
<p>Autosave couldn't be built simply by overwriting the whole project at fixed intervals. As the number of resources grows, the cost of serializing everything grows, and rewriting images and fonts every time is inefficient. So internally I tried to handle changed document state and resource state separately. The XHTML/CSS strings being edited were saved quickly, and blob resources were updated only when they were added or replaced.</p>
<p>This decision later became a major backbone of Opkle Editor. Concepts such as local-first storage, autosave, work recovery and project management inside the browser became important from this point on. Still, as with the rest of the first implementation, it was technically meaningful but didn't fundamentally change the user's working experience. However stable the saving was, if the editing screen was still code-centered, users kept finding it hard.</p>
<h2>The Limits I Hit Right After the First Build</h2>
<p>After finishing the first build, I showed it to some authors I knew. I was fairly confident. I had added EPUB project creation, OPF setup, XHTML/CSS editing, resource drops, automatic manifest updates and IndexedDB autosave, so I thought it was far easier than the existing tools. As a developer, I had certainly cut a lot of friction.</p>
<p>But the authors' reactions were different. They still said it was hard. More precisely, the difficulty I thought I had reduced wasn't the users' core difficulty. Without knowing HTML and CSS syntax in detail, it was hard to understand why the screen was split into so many code areas. There was a body editor and a style editor separately, tags carried classes, and the CSS had to call those classes back in as selectors.</p>
<p>I had thought that wrapping tags automatically would make things easier, but to users the automatically wrapped tags were themselves unfamiliar. Even if you let them change tags by double-click or right-click, if they don't know why a tag needs changing, that feature becomes a new burden instead of a convenience. Even if you let them edit CSS separately, without understanding the relationship between selectors and declarations, the freedom feels like complexity.</p>
<p>That left me feeling a little ashamed. I had said I was building a tool for creators, yet I was still designing ease from the viewpoint of someone who knows HTML and CSS. I had made people type less code, not made it possible to make a book without knowing code. Users didn't want to learn the internal structure of EPUB. They wanted to make their own books.</p>
<h2>The Conclusion That We Had to Move Beyond a Code Editor</h2>
<p>That first build was less a failure than a necessary waypoint. The system that automatically generates the EPUB project structure, updates the OPF manifest, saves to IndexedDB and handles HTML and CSS on top of CodeMirror 6 clearly remained an important foundation afterward. The editor's storage structure, resource management and sense of packaging were formed then.</p>
<p>But that build also showed me what problem I really had to solve. The difficulty of making EPUBs didn't lie simply in having to type a lot of tags. It lay in the creator having to keep thinking in the concepts of HTML and CSS while making their book. Show tags to someone who wants to fix a paragraph, show selectors to someone who wants to adjust the feel of an image, and the language of the work keeps shifting.</p>
<p>From then on I thought the editor had to change more deeply. Making a code editor a bit friendlier wasn't enough. The screen creators look at had to move closer to the structure of the book itself, and the way of working had to change from the units of code to the units of paragraphs, images, scenes and styles. HTML and CSS weren't going to disappear; they had to work quietly behind the editor.</p>
<p>The first implementation taught me something very important. The ease a developer imagines and the ease a creator feels can be different. If you don't admit that difference, however many features you add, the tool will keep wearing a difficult face. From then on, Opkle Editor had to become not a mere EPUB code editor but an editing environment where creators handle their own books directly.</p>]]></description>
      <category>dev</category>
      <pubDate>Sun, 28 Jun 2026 08:21:35 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: The Preview Became a Second Editor</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-3?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-3?lang=en</guid>
      <description><![CDATA[<p>By the time the first build was behind me, one thing was clear. Handling HTML and CSS a little more comfortably on top of CodeMirror 6 wasn't enough. Creators wanted to see the page of the book, not the code, and they wanted to touch paragraphs, images and margins in something close to how they would actually be read. So the next step naturally became the preview. But this preview was not a simple preview panel. What I wanted to build was a screen that you look at and edit at the same time.</p>
<p>From that moment, there were many more layers to design. If a paragraph was edited in the preview, the XHTML string in the CodeMirror 6 behind it had to change, and if a style changed, the CSS string had to be updated too. And the result had to be saved to IndexedDB again. Conversely, when code was edited in CM6, the preview DOM had to be re-rendered. I needed a structure in which the screen, the code strings, the internal document state and the data saved in IndexedDB all pointed at the same document.</p>
<p>From the start I felt this part needed more careful design than ordinary two-way synchronization. The DOM is a living object, HTML and CSS are serialized strings, and IndexedDB holds a stored snapshot. Each has its own sense of time. At the instant a user drags a block on screen, you have to decide in advance at what granularity that change is reflected in the HTML, how far the CSS gets recalculated, and when the save is committed. From this point Opkle Editor began to grow from a simple code editor into a state synchronization system.</p>
<h2>Between an iframe and Shadow DOM</h2>
<p>The first thing I worried about when building the preview screen was isolation. The EPUB body has to render in an independent CSS environment. The editor's own UI styles and the book's CSS must not mix. If classes used for buttons, panels, toolbars and popups collide with classes inside the book, the preview becomes a screen you can't trust. So at first I weighed both an iframe and Shadow DOM.</p>
<p>An iframe is strong on isolation. It has its own document context, and its CSS and JavaScript execution environment can be separated from the parent. It can even be treated as an independent document, much like a real reading system. But once you start using it as an editor, the cost grows. You have to keep connecting selection, drag events, the context menu, resource paths, focus and undo/redo between the parent editor and the DOM inside the iframe. It can be done with postMessage or direct contentWindow access, but the denser the editing events became, the heavier that boundary felt.</p>
<p>Shadow DOM was a different kind of choice. It lets you get style scoping while staying in the same document, and you can keep it closer to the editor's state management and event system. If I rendered the EPUB body DOM inside a shadowRoot, I could inject the book's CSS in there and separate it, to a degree, from the outer UI styles. At the same time, it was easy for the parent-side TypeScript code to track the block nodes inside the shadowRoot directly and attach events to them.</p>
<p>In the end I chose Shadow DOM. It wasn't a perfect reading system sandbox; it was a choice made to build an editable preview surface. That choice largely determined the structure that followed. The EPUB body was no longer a plain string but a live DOM tree inside a shadowRoot, and each element of that DOM tree began to be treated as an editable block.</p>
<h2>Splitting the Preview DOM into Blocks</h2>
<p>After choosing Shadow DOM, how to view the body text as editing units became important. If the whole HTML is handled as one big string, the user is still trapped inside the logic of a code editor. So inside the preview I began handling elements such as paragraphs, headings, images, containers and column structures as blocks. Each block had to be a DOM node and, at the same time, be able to return to the original XHTML.</p>
<p>In this structure each tag is no longer a plain HTML element but an editable object. I rendered elements such as <code>p</code>, <code>h1</code>, <code>img</code>, <code>section</code> and <code>div</code> inside the shadowRoot, gave each element a block id or data attribute, and attached events such as pointer event, click, double click, contextmenu, dragstart, dragover and drop at the block level. I wanted a flow where clicking a paragraph on screen selects it, dragging it reorders it, and dropping an image file inserts an image block at that spot.</p>
<p>From here on I was very conscious of the feel of block editors like Notion. To change the order of text, the user doesn't cut and paste HTML strings; they drag a block they see on screen, the internal DOM order changes, and the result is serialized back into the XHTML string. Likewise, for splitting columns or changing image placement, I tried to avoid typing CSS directly, instead changing the block's layout state and letting that state be reflected as a class or style rule.</p>
<p>In block-based editing, the serialization path mattered. After manipulating the DOM, you need rules for turning that state back into the original XHTML. When the user reorders paragraphs, the parent node's child order changes, and that order has to be reflected in the string. Adding an image block means the resource store, the OPF manifest, the body XHTML and the preview DOM all have to change together. When creating a column layout, you simply have to decide whether it is a matter of wrapping the DOM, attaching a class, or generating a CSS rule.</p>
<h2>Editing in the Preview, CM6 and IndexedDB</h2>
<p>As I added preview editing, I also reworked the synchronization rules with CodeMirror 6. In the first build, CM6 was close to the source of truth. When the user edited the XHTML/CSS strings in CM6, the internal state changed, and saving wrote that to IndexedDB. Once preview editing came in, the user was changing the DOM inside the shadowRoot directly rather than CM6, so I needed a flow that sends those changes back to the CM6 strings.</p>
<p>I couldn't just treat CM6 as a hidden store at that point. CM6's EditorState, undo history and document string also had to match the real state. So when a change occurred in the preview DOM, I thought in terms of converting it into an XHTML string patch and updating the document through CM6's dispatch. If the DOM saved straight to IndexedDB, CM6 would be holding a stale string, and the state would fall out of step the next time the user opened the code tab.</p>
<p>For example, editing one paragraph in the preview isn't finished by changing the shadowRoot's textContent. You have to find the range in the original XHTML through the block id linked to that paragraph, escape the new text, and replace the corresponding string range. The change has to go into CM6 as a transaction, and that transaction in turn passes through the update listener and can trigger a preview rerender. I had to prevent that loop. If you don't distinguish the source, whether a change came from the preview or directly from CM6, the same edit can be applied twice or the render can repeat.</p>
<p>CSS was similar. If you change a block's margin, width or column layout in the preview, it isn't just a matter of changing DOM style. It has to survive when exporting to EPUB too, so it must remain as a CSS string, an inline style, or a class-based rule. For a change seen in the preview to reproduce in the export and in reading systems, I needed rules for serializing screen manipulations into CSS state.</p>
<h2>Not a Final Stage but a Layer That Keeps Moving</h2>
<p>With preview editing in, I also divided the IndexedDB saving more finely. In the first build, it was enough to save changes to the CM6 strings. But now changes had several sources. XHTML/CSS edited directly in CM6, block reorders from the shadowRoot, resources added by image drops, CSS state produced by layout manipulation, and synchronization between responsive previews were all things to be saved.</p>
<p>If you delay saving too long, users get anxious. In a browser-based editor, losing work is fatal. On the other hand, if you rewrite the whole project to IndexedDB on every event, performance collapses. In projects containing image and font blobs especially, saving a full snapshot is a burden. So I had to think about saving as separate things: document strings, resource blobs, metadata and UI state.</p>
<p>When a small edit happens in the preview DOM, I first update the internal document state, reflect the result in the CM6 document, and save only the changed XHTML string. When an image file is added, I put the resource in the blob store, update the OPF manifest state, and insert a reference into the body XHTML. A layout change updates the CSS state, re-serializes the CSS string, and saves it. If you don't split the save path by change type like this, one small edit spreads into saving the whole project and the editor gets heavy.</p>
<p>From this point on, autosave was no longer a simple debounce function. I had to think about which change goes to which store, how to queue another change that arrives mid-save, and how to roll back the UI state if an IndexedDB transaction fails. The user had merely moved one paragraph, but inside, DOM reorder, XHTML serialization, CM6 dispatch and an IndexedDB write all had to be linked into one flow.</p>
<h2>Mobile and Tablet Previews at the Same Time</h2>
<p>For EPUB, media queries matter a great deal. It's not enough for it to fit one screen width like a web page; you have to consider e-readers, tablets, phones, and even the user's own font size and margin settings. So I felt one preview screen wasn't enough. I wanted to see a tablet-like width on one side and a phone-like width on the other at the same time.</p>
<p>At first I thought this too was simply a matter of rendering the same HTML into two viewports. But once the preview becomes editable, it's a different story. A tablet shadowRoot and a mobile shadowRoot each exist, and both must look at the same XHTML/CSS state. If the user edits a paragraph on the tablet side, the mobile-side DOM has to change immediately, and if they reorder blocks on mobile, the same order has to be reflected on the tablet side.</p>
<p>In the end the multiple preview DOMs couldn't be independent originals; they had to be different projections of the same document state. There must be a single source of truth, and the shadowRoots had to be the result of rendering that state to each viewport's conditions. Otherwise the tablet DOM and the mobile DOM become different books. The moment the result depends on which side you edited on, the editor loses trust.</p>
<p>So even when an editing event occurred in one particular preview, it had to go straight up to the common document state. That state is reflected in the XHTML/CSS strings, updates CM6 and IndexedDB, and then flows back down to every preview target. Whether you edit on the tablet or on mobile, the flow had to be the same. There could be many screens, but only one document.</p>
<h2>Real-Time Synchronization</h2>
<p>At this stage the structure of Opkle Editor grew from “a tool for making EPUB files” into “a system that reflects the state of one book across multiple layers of representation at once.” The strings in CodeMirror 6, the block tree in Shadow DOM, the mobile and tablet previews, a style state close to the CSSOM, and the project data saved in IndexedDB were all designed to point at the same state.</p>
<p>Real-time synchronization looks like a UI that responds instantly, but internally it's the work of settling order and origin well. I decided in advance which source takes precedence if a CM6 update arrives while the user is dragging a paragraph in the preview, how to keep the selection while a CSS edit triggers a preview rerender, and in what order to commit if another block edit comes in before a saving IndexedDB transaction finishes. Only with that kind of design can the UI move lightly while the internal state stays intact.</p>
<p>This structure isn't a convoluted mechanism; once you set the criteria precisely, it runs quite cleanly. I saw the editor not as a “string editor” but as “a system that projects document state onto multiple rendering surfaces,” and I put the common document state at the center. HTML and CSS remained the core of the final product, but the surfaces users touch directly moved to blocks, layout and preview. CM6 didn't go away. I kept it as the layer that maintains the accuracy of the internal strings, and made sure results from Shadow DOM edits pass through the CM6 dispatch and IndexedDB saving flow.</p>
<p>As a result, this synchronization structure came together with real polish. When a block was moved in the preview, the DOM order changed, that change was reflected in the XHTML string and the CM6 state, the changed document and resource state were saved to IndexedDB, and the mobile and tablet previews were realigned to the same document state. Choosing Shadow DOM over an iframe also proved the right call for this structure. I organized the flow so that the editing surface, the code strings, the saved data and the responsive previews wouldn't drift apart, and it passed repeated reviews and tests reliably. The preview was no longer an auxiliary screen but the core editing engine of Opkle Editor.</p>]]></description>
      <category>dev</category>
      <pubDate>Sun, 28 Jun 2026 08:21:35 GMT</pubDate>
    </item>
    <item>
      <title>Building Opkle Editor: Editing Media Queries Too</title>
      <link>https://opkle.app/abstract/blog/dev/epub-editor-dev-log-4?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/dev/epub-editor-dev-log-4?lang=en</guid>
      <description><![CDATA[<p>Once the structure for synchronizing several Shadow DOM previews at once was in place, the next possibility was immediately visible. This editor didn't need to stop at simply showing an EPUB in advance. It could instead pull media query support, which matters so much in EPUB3, into the editing process itself. It could become an editor where you edit one document while watching mobile, tablet and desktop screens together, and check different layouts and images under each screen condition.</p>
<p>In EPUB, media queries are not an extra. Readers may read on a phone-sized screen, on a tablet or e-reader, and may switch between light mode and dark mode depending on the app's settings. For an ordinary web page you can review against a few browser viewports, but EPUB is affected much more by the reading system's environment and the reader's settings. So the editor had to be not a tool for checking whether a book looks good on a single screen, but a tool for checking how the book's structure holds up under many reading conditions.</p>
<p>I framed this structure along two axes: a viewport axis of mobile, tablet and desktop, and a color scheme axis of light mode and dark mode. That effectively yields six main preview targets: mobile light, mobile dark, tablet light, tablet dark, desktop light and desktop dark. Each Shadow DOM looks at the same document state but renders under different media and color conditions. From then on, Opkle Editor was no longer a tool for editing only the body text but an editor that reviews and adjusts even the media query state in real time.</p>
<h2>Preview Targets by Screen Size and Color Mode</h2>
<p>The earlier preview began as a structure showing mobile and tablet at the same time. Adding a desktop preview makes three basic viewport axes. Each preview has its own shadowRoot and renders from the same XHTML and CSS state. But in real EPUB reading, light mode and dark mode matter as much as screen size. So I separated the color scheme out as its own axis.</p>
<p>I kept the structure simple. There is one document state and several preview targets. Each target has a viewport profile and a color profile. The viewport profile carries width and height conditions like mobile, tablet and desktop, and the color profile carries light or dark. When rendering, the same block tree is used, but the CSS context and root attributes injected into the shadowRoot differ. For example, if the preview root is given states like <code>data-view="mobile"</code> and <code>data-theme="dark"</code>, the CSS applies according to those conditions.</p>
<p>This makes the flow of editing events clean. Even if a user fixes a paragraph in the mobile dark preview, the source document state changes, and the result is projected again onto the other five preview targets. Conversely, if they change an image layout in desktop light, the same state is saved, and each target shows the result for its own conditions. There are six screens but one document.</p>
<p>The light/dark toggle also slotted naturally into this structure. Pressing the button couldn't just change the editor's UI theme; it also had to change the color condition of the EPUB body preview. I needed to be able to see right away how the background, text color, link color, image contrast and table line color look in dark mode. The toggle was not a UI convenience but a device for switching the actual reading conditions of the EPUB.</p>
<h2>Light Mode and Dark Mode</h2>
<p>If you manage dark mode like a separate document, it gets complicated fast. You can't end up with a light XHTML and a dark XHTML for the same body text. An EPUB should keep one body structure and let the presentation change according to CSS conditions. So I handled light and dark not by duplicating the HTML but through a combination of CSS state, media queries and a theme attribute.</p>
<p>The key was to keep the body structure and change only the presentation layer. I wrote CSS that responds to <code>prefers-color-scheme</code>, and in the editor preview I put in an explicit theme state so light and dark could be forced. In a reading system it can follow the user's settings, and inside the editor you can check each mode directly with a button. That way the CSS that goes into the real EPUB and the editor preview run on the same principle.</p>
<p>Changing only colors wasn't enough. In dark mode, image brightness and contrast, table borders, highlight backgrounds, link colors and the gray levels of captions can all differ. Images in a book especially may look fine on a light background but appear to float on a dark one, or get lost in it. So images and tables had to respond to media and theme conditions more actively than ordinary paragraphs.</p>
<p>Once the structure was in place, reviewing became far clearer. You no longer have to look only at mobile light on one screen and judge “looks fine.” The same paragraph and the same image appear under six conditions at once, and every condition updates the instant you edit. EPUB media queries were no longer something written only in code; they became something you see and adjust directly inside the editor.</p>
<h2>A Component That Carries Six Conditions Together</h2>
<p>The most important part was images. In EPUB, an image doesn't end with a single <code>img src</code>. A vertically cropped image may suit mobile better, an image with margins may be good for tablet, and a wider aspect ratio may be needed for desktop. Add light and dark modes, and the same scene needs up to six image variants.</p>
<p>The solution was clear. Instead of seeing an image as a reference to one file, I could make it a component that carries several variants together. An image block can internally hold resource references for mobile light, mobile dark, tablet light, tablet dark, desktop light and desktop dark. If images go into this component structure from the moment the user adds or creates them, you never have to bolt on media query support awkwardly later.</p>
<p>In the XHTML this component looks like a single image block, but its internal state holds several resource paths. CSS decides which variant to show depending on viewport and theme conditions. Depending on the situation, the implementation can go the <code>picture/source</code> route, or a combination of CSS background and class, and inside the editor it can pick the resource that fits the current target through a data attribute. What mattered was that behind the user's action of “adding one image” there is an image model holding multiple reading conditions.</p>
<p>The OPF manifest also had to be updated to match this structure. With six variants, all six resources must be included in the package, with each media-type and path registered accurately. When an image is generated or replaced, the component state, resource store, manifest state and preview DOM all change together. Because of the synchronization structure I built in Part 3, this flow followed naturally.</p>
<p>This approach was very solid. A user can swap the mobile dark image while keeping a different image in desktop light. The editor shows the correct variant in each preview target, and on save it preserves the component state and the manifest together. As long as the media query CSS is written thoroughly, the same principle holds inside the EPUB too.</p>
<h2>Image Generation Built Around Components Too</h2>
<p>Once the image component became the standard, image generation itself had to change as well. Making a single image and dropping it into the body, as before, isn't enough for a responsive EPUB. You have to know from the start under what conditions this image will be used. You have to think together about the aspect ratio needed on mobile, the margins needed on tablet, the resolution needed on desktop and the contrast needed in dark mode.</p>
<p>So I designed the image generation flow around component state as well. When a user creates one image block, that block isn't a single file but a variant container. After that, they can generate or replace an image for each condition and check it right away while watching the preview targets. If an image is too bright in the mobile dark preview, they can replace only that variant and leave the desktop light preview alone.</p>
<p>This structure is good for creators and good for the EPUB package. Creators can adjust while seeing directly “which image shows on which screen,” and internally every variant is managed as an explicit resource. At export time, it is also easy to trace which image is used where. To avoid missing manifest entries or wrong references, everything from component state to OPF registration can be tied into a single flow.</p>
<p>As a result, images became a much more active unit of expression within the EPUB. Instead of a single image being forced to fit every screen, the structure can show different images depending on the reading environment. This was an important point where Opkle Editor brought the strengths of EPUB3 into the real production experience.</p>
<h2>Flex Layout and Responsive Structure</h2>
<p>Tables were an important problem too. In EPUB, tables often fall apart on small screens. On desktop or tablet a side-by-side horizontal structure is natural, but on mobile the same structure gets too narrow, the text shrinks, or it can create horizontal scrolling. If you use ordinary HTML tables as they are, presentation can also vary widely between reading systems.</p>
<p>So it was more stable to handle tables and table-like layouts as flex-based components. On desktop and tablet, <code>flex-direction: row</code> places the cells or columns side by side, and on mobile <code>flex-direction: column</code> creates a vertical flow. The information structure stays the same, and only the arrangement changes with the reading conditions. This approach also fit EPUB's reflowable reading well.</p>
<p>What mattered was not to turn a table into merely a “nice-looking box.” Internally it had to keep the meaning of rows, columns and cells, and in the preview it had to be editable like a block. When a user views the table in the mobile preview, each item follows the next calmly in a vertical line, and on tablet or desktop they sit side by side for easy comparison. CSS media queries change only the presentation of this structure.</p>
<p>This table component ran on the same principle as images. The document state holds the information structure, the CSS state holds the per-viewport placement rules, and the preview targets render that combination. When the user edits the table's content, it is reflected in all previews, and when they change a layout option, the CSS rule is updated. The switch between <code>row</code> and <code>column</code> looks like a simple style change, but it was actually the key device for supporting small screens reliably in EPUB.</p>
<h2>Media Queries as a Hands-On Editing Experience</h2>
<p>At this stage Opkle Editor moved away from the approach where a developer writes media queries in code and checks them afterward. Mobile, tablet and desktop previews are visible at once, light and dark modes switch with a button, and image and table components respond to each condition. Users edit while watching the result, and the editor reflects that result consistently in the XHTML, CSS, resource store, OPF manifest and IndexedDB.</p>
<p>Technically, the key was dividing the state axes well. The document state handles the semantic structure of the body text. The media state handles viewport conditions. The theme state handles light and dark modes. The resource state handles image and font variants. CSS serialization turns these states into rules that can be reproduced inside the EPUB. Each Shadow DOM preview is the rendered result of a combination of these states.</p>
<p>Organized this way, the system becomes very robust. Whichever preview you edit in, the source is one, and whichever mode you view in, each condition is clear. Even if an image changes in mobile dark, desktop light doesn't wobble, and even if you change the table's mobile column layout, the tablet row layout keeps its own rules. At the same time, all the resources and CSS go into an exportable EPUB structure.</p>
<p>As a result, media query support came together with real polish. I could edit while reviewing the combinations of mobile, tablet and desktop with light and dark at once, and image variants and flex-based table layouts also ran reliably inside the EPUB package. In repeated reviews, the preview, CSS, manifest and IndexedDB saved state matched up consistently. From then on, Opkle Editor was no longer simply a tool for making EPUBs but a system where you can actually edit the responsive expressiveness of EPUB3.</p>]]></description>
      <category>dev</category>
      <pubDate>Sun, 28 Jun 2026 08:21:35 GMT</pubDate>
    </item>
    <item>
      <title>How Reading Changed After Text Hip</title>
      <link>https://opkle.app/abstract/blog/texthip/reading-culture-after-text-hip?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/texthip/reading-culture-after-text-hip?lang=en</guid>
      <description><![CDATA[<p>Text hip, the Korean trend that made reading and writing look cool again, has drawn reading out a little from being a quiet, solitary act. A book can still be read alone. But in today's reading culture, the place you read, the people you read with, the way you record a book, and the conversation you have afterward have all become more important. Reading is no longer explained by the single image of sitting at a desk and reading to the end.</p>
<p>This change is happening alongside a fall in reading rates. In the Ministry of Culture, Sports and Tourism's 2025 national reading survey, the annual overall reading rate for adults fell to 38.5%, while the overall reading rate for people in their twenties was 75.3%.<sup>1</sup> The reading ecosystem as a whole is weakening, yet among part of the younger generation the way of meeting books is being renewed.</p>
<p>Reading after text hip does not ask only “How much did you read?” It also asks how you came into the book, at which sentence you stopped, with whom you shared your impressions, and what scene the book became in your daily life. In this article, we look at how reading is widening from a personal habit into a shared culture.</p>
<p>1. We look at why reading is changing from a solitary activity into a shared experience.</p>
<p>2. We find out about new entrances to reading, such as reading parties, book-swap reading, and BookTok.</p>
<p>3. We think together about the possibilities and limits of making reading an image.</p>
<p>4. We sum up the conditions needed for a good reading culture.</p>
<h2>Reading Has Become a More Often Shared Experience</h2>
<p>There was a strong perception that a book is something you read alone. Deep reading certainly still needs time alone. But in the reading culture after text hip, solitary reading and reading together blend more naturally. You read alone, take a photo, share a sentence, talk about it at a gathering, and then read alone again.</p>
<p>The reading party shows this change well. A traditional book club usually has everyone read one book beforehand and come to discuss it. A reading party, by contrast, does not require reading the same book, nor a long discussion. People who love books gather in the same space and create the atmosphere of reading together, each reading their own book or swapping books.<sup>2</sup></p>
<p>Such a format lowers the threshold of reading. You don't have to have read a book perfectly and prepared deep opinions to take part. The wish to be near books is enough to begin. For a reading culture to last, such light entrances are needed too. For someone who feels reading is like homework, “Let's open our books at the same time, together” may be a better start than “You have to read to the end.”</p>
<p><strong>New Forms of Reading Together</strong></p>
<ul>
<li>Reading parties, where each person reads their own book in the same space</li>
<li>Book-swap reading, passing a book around with underlines and notes left in it</li>
<li>Reading records on social media, sharing sentences and impressions</li>
<li>Curated reading that follows the recommendation lists of people you like</li>
<li>Offline gatherings that meet around books in bookstores, cafés, and class spaces</li>
</ul>
<h2>Book Fairs and Independent Publishing Events Grow the Scenes of Reading</h2>
<p>The reading culture after text hip is wider than the act of buying books. The place where you meet books becomes a cultural experience in itself. HeyPop reported that the 2025 Seoul International Book Fair drew 150,000 visitors over five days, and that tickets sold out early at the online pre-booking stage.<sup>2</sup> It also covered cases such as independent publishing festivals, reading parties, and book-swap reading.<sup>2</sup></p>
<p>Events like these do not leave books as isolated objects. A book becomes a scene where authors, readers, editors, bookstores, goods, readings, lectures, and communities meet. Readers are not consumers who only buy, but participants who meet books within a certain atmosphere and set of relationships.</p>
<p>Such scenes matter especially for young readers. Even people who haven't read many books can come close to them through book fairs, independent bookstores, and book clubs. For a reading culture to come alive, it needs not a space that welcomes only those who have read a book to the end, but one that people who haven't yet started reading can enter as well.</p>
<p>From this angle, book fairs and independent publishing events become more than sales events. They are social proof of reading. Even someone who couldn't read well alone gets a sense, from the sight of many people gathered before books, that reading is still a living culture. Text hip magnifies exactly this sense. It makes visible the fact that there are people who read, and that visible scene calls other people to books in turn.</p>
<h2>BookTok Brought Books into the Video Platform</h2>
<p>Text hip cannot be seen as a phenomenon of Korea alone. Abroad, a culture of introducing and recommending books through short videos, like BookTok, has grown. In a 2022 survey, the UK's Publishers Association announced that 59% of respondents aged 16 to 25 said BookTok or book influencers had helped them discover an interest in reading.<sup>3</sup></p>
<p>This number shows something important. Video platforms are not only an enemy of books. Short video can of course get in the way of long reading. But at the same time it can be an entrance that lets people discover books. Someone who didn't know a book can remember its title because of one video, look for it in a bookstore, and open an ebook preview.</p>
<p>The heart of text hip lies here as well. Books compete with video and yet are rediscovered within video. A book's cover, a reader's expression, a short recommendation, an emotional reaction, a single line of text become the door into the book. Reading in the digital age is not a return to the analog but closer to making new paths by moving between the digital and paper.</p>
<h2>The Sight of Reading Has Become Part of Reading</h2>
<p>In text hip, reading becomes a visible activity. Which book you hold, in what café or bookstore you read, and what sentence you photograph become part of the reading experience. It is hard to call this merely shallow. People naturally build relationships by showing what they like. Just as we share playlists after listening to music, we can share sentences after reading a book.</p>
<p>The trouble arises when the image of reading pushes out actual reading. It is fine not to finish a book. It is fine not to understand every book deeply. But when books become props purely for atmosphere, the reading culture has trouble lasting. A balance is needed between showing books and reading them.</p>
<p>A good reading record does not leave only a photo. It leaves at least a little about why you chose the book, at which sentence you stopped, and how your thinking changed after reading. A record can be not a decoration for showing off reading but a tool for holding on again to the time you read.</p>
<p>So there is no need to set visible reading and actual reading time against each other without condition. The problem arises when visible reading replaces real reading. Conversely, if visible reading helps you choose a book to read, remember what you read, and talk with other people, it becomes part of the reading experience. Reading culture after text hip keeps swaying between these two possibilities.</p>
<h2>The Reading Crisis and the Reading Trend Exist at the Same Time</h2>
<p>When speaking of text hip, the thing to be most careful about is optimism. A few reading events and social media trends do not mean the reading culture as a whole has recovered. In the 2025 national reading survey, the adult reading rate was 4.5 percentage points lower than in 2023, and the annual number of books read by adults fell as well.<sup>1</sup></p>
<p>So text hip is better seen not as a result of having solved the reading crisis but as a possibility that appeared within it. There is the larger flow of people not reading books, and at the same time some people are making books a more special hobby. The two flows look contradictory but in fact exist together.</p>
<p>Knowing this complexity is how we can build a good reading culture. Saying only that “books have become hip” misses reality, and saying “it's just a fad anyway” misses the new entrances. What's needed is to widen the entrance and to help real reading, conversation, and creation continue inside it.</p>
<h2>A Good Reading Culture Designs the Entrance and the Inside Together</h2>
<p>People come to books for many reasons. They may begin because it looks cool, because someone recommended it, because of a lovely cover, because they want to go to a book club, or because a sentence stayed with them. These are perfectly good entrances. But for a reading culture to deepen, there has to be an inside behind the entrance.</p>
<p>The inside means actual reading time, the practice of turning impressions into words, the attitude of listening to different interpretations, and the habit of looking further into a book's context. Book clubs and classes, independent bookstores and publishers, and online platforms can play the role of building this inside. They should not stop at showing books as cool objects. They should help people grow into those who read books.</p>
<p>Reading after text hip has widened. But the wider it gets, the more easily it can scatter. So the reading culture from here on needs good questions, good conversation, and good records just as much as lovely covers and good photographs. For reading to become culture again, the way books are shown and the time spent reading them have to grow together.</p>
<p><small>1: Ministry of Culture, Sports and Tourism, press release on the “2025 National Reading Survey” (Mar. 6, 2026). Announced results including adult overall reading rate 38.5%, overall reading rate for people in their twenties 75.3%, and a 4.5 percentage point drop in the adult reading rate from 2023.<br>2: HeyPop, “The Age of ‘Text Hip’: This Is How People Read Now.” Introduces cases of the new reading culture such as reading parties, book-swap reading, and 150,000 visitors to the 2025 Seoul International Book Fair.<br>3: Publishers Association, “The BookTok Generation: How social media is transforming Gen Z reading habits” (Nov. 23, 2022). Covers the influence of BookTok and book influencers in a survey of more than 2,000 people aged 16-25.</small></p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>After text hip, reading has widened from a solitary habit into a culture of recording, sharing, and enjoying together.</li>
<li>Reading parties, book-swap reading, book fairs, and BookTok become new entrances for discovering and starting books.</li>
<li>Making reading an image risks drifting into showing off, but if it leads to real reading and reflection, it can be a good reading experience.</li>
<li>Because the reading crisis and the reading trend exist at the same time, we need a structure that widens the entrance and still leads to deep reading.</li>
<li>A good reading culture lasts only when the way books are shown and the time spent actually reading are designed together.</li>
</ul>]]></description>
      <category>texthip</category>
      <pubDate>Fri, 26 Jun 2026 04:14:21 GMT</pubDate>
    </item>
    <item>
      <title>How Creators and Publishers Can Work with Text Hip</title>
      <link>https://opkle.app/abstract/blog/texthip/text-hip-and-creators?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/texthip/text-hip-and-creators?lang=en</guid>
      <description><![CDATA[<p>Text hip, the Korean trend in which reading and writing have come to be seen as cool, is not a movement of readers alone. It is also an important signal for creators, publishers, independent bookstores, and class operators. People still want books and sentences. It is only that the ways they discover, read, record, and share books have changed. Understanding this change lets you connect good writing and books to readers more naturally.</p>
<p>Cheil Magazine introduced cases within the text hip trend such as transcription experiences, offline experiences built around poetry, and brand books.<sup>1</sup> The KB Financial Group Research Institute also extended its treatment of text hip to changes in related industries and corporate examples.<sup>2</sup> This means books and sentences no longer move only within the publishing world. Sentences combine with brands, education, communities, and offline experiences.</p>
<p>But working with text hip does not only mean packaging a book prettily. A cover can be an entrance, but what makes readers stay is, in the end, the content. For creators and publishers to use text hip in a healthy way, they must build sentences that are easy to discover together with a structure that can be read for a long time.</p>
<p>1. We look at the signal text hip gives to creators and the publishing ecosystem.</p>
<p>2. We find out about new entrances that make books and writing discoverable.</p>
<p>3. We think about ways to extend the reading experience into communities and classes.</p>
<p>4. We sum up standards for following a trend without losing the depth of the writing.</p>
<h2>Readers Meet a Scene Before They Buy the Book</h2>
<p>Today's readers do not necessarily meet books only on bookstore shelves. They meet books first through a short sentence on social media, a photo of someone's desk, a book club review, a book talk video, a newsletter recommendation, or a writer's record of their work. They meet a scene from the book before they buy it.</p>
<p>This change is both a burden and an opportunity for creators. Making a good book is often no longer enough. Readers need an entrance of sentences, images, stories, and experiences through which they can come into the book. But this entrance must connect to the essence of the book, not to exaggerated advertising.</p>
<p>For an essay, for example, rather than promoting just one sentence, you can show the context of the life in which that sentence arose. For a practical book, you can show in a short case the problem readers actually want solved. For an independently published work, the production process, the materials, and the editorial choices can become the book's charm. In the age of text hip, the stories around a book also become part of what makes it discoverable.</p>
<p>Still, building an entrance is different from making a book light. The first sentence readers meet may be short, but the world that sentence points to must be deep. Rather than polishing promotional lines separately, creators should find sentences within the manuscript that can truly hold readers. Only then will the moment of discovery and the time of reading not part ways.</p>
<p><strong>New Entrances into a Book</strong></p>
<ul>
<li>A short sentence that shows the heart of the book</li>
<li>The author's working process and notes</li>
<li>A transcription or recording challenge readers can follow</li>
<li>Book clubs and offline experiences for reading together</li>
<li>Curation through independent bookstores, classes, and newsletters</li>
</ul>
<h2>Publishing Will Design Experiences More Than Sales</h2>
<p>Publishing after text hip cannot rely only on releasing a book and waiting. It has to design together how readers discover the book, in what way they read it, and what they leave behind afterward. A book becomes both a product and an experience.</p>
<p>The reading parties and book-swap reading introduced by HeyPop show this well.<sup>3</sup> People who read books no longer leave only a finished review. They turn the reading process itself into an event, meet other people's underlines and notes, and feel a sense of belonging while each reads their own book in the same space. Such experiences create a value of reading that is hard to explain by sales figures alone.</p>
<p>Publishers, independent bookstores, and creative classes can make use of this trend. When introducing a new release, instead of just explaining the plot, they can offer questions readers can try while reading. A space that sells books can become more than a place for choosing books. It can become a place that creates reading time. Publishing increasingly moves between content and community.</p>
<h2>Creators Must Build Both a Shareable Sentence and a Structure That Holds</h2>
<p>In the age of text hip, one sentence can bring a reader in. Readers are drawn to a sentence before they know the whole book. So creators cannot ignore the power of a shareable sentence. A memorable sentence, one you want to underline, one you want to send to someone, is certainly important.</p>
<p>But a good book is not a collection of quotations. If one sentence brought the reader in, the whole book must hold that reader. The context in which the sentence sits, the flow between chapters, and how the opening question changes by the end all have to be firm. The shareable sentence is the entrance, and the structure that holds is the inside.</p>
<p>When this balance breaks, a book is easily consumed and quickly forgotten. When the balance is right, a short sentence leads to long reading. Creators should make sentences readers can enter by, and make the inside of the book deep enough that readers who come in are not disappointed.</p>
<p>From the viewpoint of editing, too, this balance matters. The title, copy, and cover lines are devices that bring readers in. But the table of contents, the flow of chapters, the density of paragraphs, and the placement of examples are devices that make readers finish. Editing in the age of text hip becomes the work of handling discoverability on the outside and finishability on the inside at the same time.</p>
<h2>Brands and Companies Should Write Books as a Form of Trust, Not Advertising</h2>
<p>Text hip affects companies and brands, too. Cheil Magazine introduced cases such as transcription experiences, offline marketing that prescribes poems, and a financial platform's brand book in connection with text hip.<sup>1</sup> The KB Financial Group Research Institute also summarized that text hip is extending into corporate brand marketing and customer service.<sup>2</sup></p>
<p>What matters here is not making a book like a flyer. Even when a book comes from a brand, readers look at whether there is real value worth reading inside. If the sentences are shallow and the message blatant, the book format works against it. A book is not a form that borrows trust. It is a form in which trust has to be built.</p>
<p>For a brand to use text hip well, rather than boasting about its own products, it should earnestly address problems readers are actually curious about. A financial brand can address the everyday sense of handling money, an education brand the bewilderment of people who are learning, a publishing brand the time of those who read and write. The book format is slow and deep. There has to be content that can bear that slowness.</p>
<h2>Classes and Workshops Can Turn Text Hip into a Deep Habit</h2>
<p>Text hip is a good opportunity for classes and workshops, too. People want to love books, but often don't know how to read and how to record. They want to write, but feel burdened when asked for a finished piece right away. Here a class can play the role of turning the entrance of a trend into a habit.</p>
<p>A good class does not make people boast of how many books they've read. It teaches how to read one sentence deeply. It has them add their own thoughts to transcribed sentences, listen to others' impressions, and turn their own experience into a short piece. A self-publishing class can connect reading and writing, editing and production, and let people experience “the process of my sentences becoming a book.”</p>
<p>Such classes turn text hip from a surface taste into real capability. They move people from consuming books coolly to reading, writing, and making them. Creators and educators are exactly the ones who can design this move.</p>
<h2>Follow the Trend, but Do Not Lose the Writing's Trust</h2>
<p>The thing to be most careful of when working with text hip is an attitude of merely chasing the trend. You can make a book look hip. But if the content is shallow when readers actually read it, if there is only an exaggerated message, or if the sources and facts are flimsy, it is hard to keep trust for long.</p>
<p>This is especially so with information-centered or educational content. Readers want accurate explanation as well as fine sentences. They need claims with sources, information with clear dates, restrained expressions, and guidance that considers the reader's situation. Even in the age of text hip, the basics of good writing do not change.</p>
<p>What creators and publishers should learn from text hip is not only the skill of packaging. It is the design that connects the moment readers feel books are cool again to real reading and writing. For books to become culture again, the way they are discovered must be renewed, and the responsibility for their content must be firmer.</p>
<p><small>1: Cheil Magazine, “Reading Is Hot! The Text Hip Trend.” Introduces text hip and related industry and brand cases such as transcription experiences, poem-prescription marketing, and brand books.<br>2: KB Financial Group Research Institute, “A Lasting Resonance Through Writing: The Power of Text” (June 30, 2025), and the KDI Economic Information Center summary. Covers the definition of text hip, the background of its rise, changes in the markets for bookstores, reading subscription platforms, social media, and reading goods, and corporate cases.<br>3: HeyPop, “The Age of ‘Text Hip’: This Is How People Read Now.” Introduces cases such as reading parties and book-swap reading, where the reading experience extends into community.</small></p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>Text hip is a signal to creators, publishers, independent bookstores, and class operators that the way books are discovered has changed.</li>
<li>Before buying a book, readers first meet scenes such as sentences, images, recommendations, gatherings, and records of the work.</li>
<li>Creators must build both a shareable sentence and a book structure that can hold up over a long read.</li>
<li>When brands and companies use text hip, they should treat the book format as a form of trust, not advertising.</li>
<li>To use text hip in a healthy way, the entrance of the trend must be connected to habits of real reading, writing, and making.</li>
</ul>]]></description>
      <category>texthip</category>
      <pubDate>Fri, 26 Jun 2026 04:14:21 GMT</pubDate>
    </item>
    <item>
      <title>What Is Text Hip?</title>
      <link>https://opkle.app/abstract/blog/texthip/what-is-text-hip?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/texthip/what-is-text-hip?lang=en</guid>
      <description><![CDATA[<p>Text hip is a Korean coinage where “text” meets “hip,” the sense of being cool. It describes a trend in which reading books, picking out sentences, copying passages by hand, and showing off long texts as part of your taste are once again seen as a stylish culture. Books have long been a symbol of refinement, but today's text hip differs a little from the old saying that “reading makes you smart.” What matters is that books and sentences have reappeared as a language of self-expression, relationships, lifestyle, and taste.</p>
<p>If we call this phenomenon simply a reading boom, we easily miss reality. In the 2025 national reading survey announced by the Ministry of Culture, Sports and Tourism in March 2026, the annual overall reading rate for adults was 38.5%.<sup>1</sup> Overall, fewer people are reading books. Yet in the same survey, the overall reading rate for people in their twenties was 75.3%, far above the adult average, and activities such as book fairs, book clubs, transcription, and book-swap reading are drawing fresh attention, centered on young adults.<sup>1</sup></p>
<p>So text hip is not the simple optimism of “people are reading lots of books again.” It is rather a phenomenon in which, in an age when reading has stepped back a little from being a common habit, the act of reading has begun to look like a clearer choice and a taste. When everyone reads, reading is ordinary, but when many people don't, someone who opens a book looks like a person with a pace and an attitude of their own.</p>
<p>1. We look at the basic concept the term text hip points to.</p>
<p>2. We think about why books and sentences are becoming signals of taste even as reading rates fall.</p>
<p>3. We distinguish whether text hip is mere showing off or a new entrance to reading.</p>
<p>4. We sum up how reading books and writing are becoming a cultural attitude again.</p>
<h2>Text Hip Is About the Attitude Toward Books, Not Just Their Content</h2>
<p>In text hip, what matters is not only which book you read. Also important are why you chose it, where you read it, which sentence you underlined, and with whom you shared that sentence. A book is a bundle of knowledge and, at the same time, an object that shows taste.</p>
<p>The KB Financial Group Research Institute described text hip as a phenomenon in which text-based activities such as reading and writing are perceived as cool and refined.<sup>2</sup> What deserves notice in this description is that text hip includes not just reading but writing. It does not end with reading. Recording, copying out, sharing, and adding your own thoughts are bound together into a single culture.</p>
<p>So text hip can be seen in three layers. The first is the layer of sensibility, in which books and sentences are accepted as cool objects. The second is the layer of behavior, in which you record and share what you read. The third is the layer of capability, in which you make your own thinking clearer based on those records. A fad can start in the first layer, but to remain as a culture, it has to reach down to the second and third.</p>
<p>In this trend, books do not remain only quiet objects. Book covers, bookmarks, transcription notebooks, independent bookstores, book cafés, book clubs, and online reviews all become scenes surrounding books. The meaning of a book extends beyond the pages to the whole process of choosing, reading, and leaving something behind.</p>
<p><strong>Basic Scenes of Text Hip</strong></p>
<ul>
<li>Showing books and sentences as your own taste.</li>
<li>Recording and sharing what you've read.</li>
<li>Creating shared forms of reading, such as transcription, book clubs, and reading parties.</li>
<li>Treating books as a tool of knowledge and as part of a lifestyle.</li>
<li>Restating the sentences you read in your own words, making them an entrance to writing.</li>
</ul>
<h2>The Fewer People Read, the Clearer Those Who Do Become</h2>
<p>In culture, figures and feelings always move together. The statistic that adult reading rates have dropped shows a weakening of reading culture. At the same time, because of that weakening, the act of reading a book can look like a sharper taste. In a society where everyone reads every day, reading is nothing special. But as more people don't read, those who do look like people with a slightly more distinct attitude.</p>
<p>In this respect, text hip is a signal on the other side of the reading crisis. It is not that text hip arose because reading rates rose. In part, because reading has become scarce, reading books has become a cultural marker again. Reading slowly, recording quietly, and lingering on one sentence become special in an environment full of fast screens and short videos.</p>
<p>From a professional viewpoint, this is not merely a change of hobby but also a matter of how attention is allocated. A person's time stays the same while the amount of content has become far greater. In this situation, reading shifts in meaning from “an activity that takes a lot of time” to “an activity that keeps attention in one place for a long while.” Behind why text hip looks cool lies not only the image of books themselves but also an admiration for the attitude of guarding your own attention in a distracting environment.</p>
<p>Still, we must not exaggerate this phenomenon into “books are back in a big way.” The 2025 national reading survey clearly shows the decline in reading rates among adults overall.<sup>1</sup> Text hip is closer to evidence that, even within a lowered reading environment, some readers are reinterpreting books as a medium of stronger taste and relationship, than evidence that reading culture as a whole has recovered.</p>
<h2>Text Hip Is Not a Rejection of the Digital but a Rediscovery Within It</h2>
<p>To understand text hip as a simple return to paper books is to see only half of it. This trend grew within digital platforms. People post photos of books, share lines that stayed with them, recommend books in short videos, and recruit book clubs online. The old medium of the book gained new paths of discovery by meeting social media.</p>
<p>The BookTok culture abroad can be seen in a similar context. The UK's Publishers Association surveyed more than 2,000 people aged 16 to 25 and announced that 59% of respondents said BookTok or book influencers had helped them discover an interest in reading.<sup>3</sup> This case shows that video platforms do not always work only as an enemy of reading.</p>
<p>Of course, short video can get in the way of long reading. But at the same time it can become an entrance to books. The way readers first meet a book has changed. Where bookstore shelves, newspaper reviews, and recommendations from teachers or friends used to be the main entrances, now a single video, one sentence, or one image within an algorithm becomes the door into a book.</p>
<h2>Text Hip Is Both Showing Off and an Entrance</h2>
<p>The criticism most often raised about text hip is the worry that it could become a culture of pretending to read. If books become backdrops for photos and sentences become decorations for dressing up one's image, reading has trouble deepening. A trend that consumes only the outward look of books can indeed arise.</p>
<p>But the entrance to a culture is often a little superficial by nature. Someone buys a book because of its cover, someone reads because a person they like recommended it, someone opens a book because one sentence caught their fancy. That the first reason is light does not necessarily mean that what lies inside is light too. What matters is whether the person standing before the book actually goes inside its sentences.</p>
<p>Good text hip does not stop at showing books. It makes you rethink the sentences you read, write down why a sentence stayed with you, and share your impressions with others. Bad text hip ends at looking like a reader. So rather than praising or mocking this phenomenon without condition, what matters is building structures that lead to actual reading and writing.</p>
<h2>Text Has Become Cool Again in the Age of Video and AI</h2>
<p>Text hip is all the more meaningful because it appeared in the age of video and AI. Short video is fast, search is easy, and AI summarizes long pieces. Yet the more this environment grows, the more people give special meaning to reading directly, choosing directly, and recording directly.</p>
<p>Text is slow. But because it is slow, thought remains. A book does not give many stimuli at once, but it lets the reader grasp sentences at their own speed. An AI-organized summary is convenient, but it cannot fully replace the experience of reading and understanding one sentence for a long time. This is because reading is not only receiving information but also judging and interpreting at my own pace.</p>
<p>So text hip can be seen not as a mere reading fad but as a movement to recover slow thinking in a fast age. That people feel sentences are cool again means that a desire for long thought, one's own language, and quiet concentration still remains.</p>
<h2>Text Hip Changes Reading and Writing Together</h2>
<p>When the way we read books changes, so does the way we write. When the path by which readers discover books changes, writers also have to think about how sentences are shared and remembered. Not only a whole book but a single sentence, a paragraph, or a scene can become the reader's entrance.</p>
<p>This does not mean writing must be made short and sensational. It is the opposite. The shorter the entrance, the sturdier the inside must be. A reader may be drawn in by one sentence, but the reason they stay is the depth and trustworthiness of the whole writing.</p>
<p>Text hip is a signal that books and writing have not disappeared. It is only a signal that the ways books and writing are discovered and shared have changed. Understanding this trend well lets us build new ways of connecting in reading education, publishing, independent bookstores, creative-writing classes, and online writing alike.</p>
<p><small>1: Ministry of Culture, Sports and Tourism, press release on the “2025 National Reading Survey” (Mar. 6, 2026). Announced results including annual overall reading rate: adults 38.5%, students 94.6%, and people in their twenties 75.3%.<br>2: KB Financial Group Research Institute, “A Lasting Resonance Through Writing: The Power of Text” (June 30, 2025), and the KDI Economic Information Center summary. Explains text hip as a phenomenon in which text-based activities such as reading and writing are perceived as cool and refined.<br>3: Publishers Association, “The BookTok Generation: How social media is transforming Gen Z reading habits” (Nov. 23, 2022). In a survey of more than 2,000 people aged 16-25, 59% said BookTok or book influencers had helped them discover an interest in reading.</small></p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>Text hip is a trend in which books and sentences, transcription and reading records are seen as a cool taste again.</li>
<li>Overall reading rates are falling, but precisely because of that scarcity, the attitude of those who read looks clearer.</li>
<li>Text hip is not a rejection of the digital but a phenomenon in which books and sentences are rediscovered within digital platforms.</li>
<li>It carries the risk of drifting into showing off, but if it leads to real reading and thinking, it can be a good entrance to reading.</li>
<li>That text draws attention in the age of video and AI is a signal that the desire for slow thinking and one's own language remains.</li>
</ul>]]></description>
      <category>texthip</category>
      <pubDate>Fri, 26 Jun 2026 04:14:21 GMT</pubDate>
    </item>
    <item>
      <title>How Text Hip Changes the Culture of Writing</title>
      <link>https://opkle.app/abstract/blog/texthip/writing-and-copying-after-text-hip?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/texthip/writing-and-copying-after-text-hip?lang=en</guid>
      <description><![CDATA[<p>Text hip, the Korean trend that made reading and writing look cool, does not change only reading. It changes writing culture along with it. Copying out sentences that stayed with you after reading, leaving impressions in your own sentences, and building up long records on a blog or social media become meaningful hobbies again. So text hip is a reading trend and, at the same time, a writing trend.</p>
<p>The Korea Press Foundation explained that the text hip trend is expanding into a craze for transcription, which it calls “writing hip,” and reported that online mentions of transcription clubs have grown 1.6 times compared with 2021.<sup>1</sup> The KB Financial Group Research Institute also treated text hip in connection with the desire to record and share.<sup>2</sup> People now do not stop at reading books. They want to leave the traces of what they read in their own language.</p>
<p>This change matters for writing education, too. Writing is no longer the business only of aspiring authors or professionals. Picking sentences, copying them out, leaving impressions, and organizing your own story become everyday ways of expression. In the age of text hip, writing comes closer to the skill of placing what you read and felt within your own life than to the skill of producing impressive sentences.</p>
<p>1. We look at why text hip is growing a culture of transcription and recording.</p>
<p>2. We find out how collecting sentences leads to self-expression and writing practice.</p>
<p>3. We think about why blogs and long records are drawing attention again.</p>
<p>4. We sum up why the ability to recognize your own sentences matters in the age of AI.</p>
<h2>Transcription Is Writing with the Lowest Threshold</h2>
<p>People trying to write for the first time often get stuck before a blank screen. They don't know what to write or how to begin. Transcription lowers this bewilderment. Slowly copying out sentences that already exist, you feel the length, rhythm, and word placement of sentences in your body.</p>
<p>Transcription is not mere copying. It is passing through good sentences again by hand. Commas, the breath of a sentence, and word choices you passed over with your eyes show themselves a little more slowly at your fingertips. So transcription can be a starting point for writing. Even without completing your own argument from the start, you can learn a sense of sentences by following good ones.</p>
<p>This is also why transcription is popular in text hip. Transcription sits between reading and writing. It is the act of reading a book and, at the same time, of leaving a trace in your own notebook. The moment you rewrite a sentence you read with your own hand, you become a slightly more active reader.</p>
<p><strong>Why Transcription Becomes an Entrance to Writing</strong></p>
<ul>
<li>It reduces the burden of the blank screen.</li>
<li>It lets you slowly feel the rhythm and structure of good sentences.</li>
<li>It leaves what you read as the memory of the hand.</li>
<li>It can lead to a record where you add your own impressions.</li>
<li>It has you observe a sentence closely before you evaluate it.</li>
</ul>
<h2>Collecting Sentences Is Discovering Your Own Taste</h2>
<p>In text hip culture, people often share sentences they like. One short sentence sometimes catches the eye before the whole book does. Collecting sentences may look light, but in fact it is a process of discovering your own taste. Looking at which sentences stay with you shows what questions you are carrying right now.</p>
<p>People do not respond to every sentence in the same way. Some are drawn to firm explanatory prose, and some to sentences with a lot of white space. Some like sentences that pierce reality precisely, and some like sentences that say their feelings for them. Collecting sentences is, in the end, looking at the pattern of your own thinking.</p>
<p>For this collecting to lead to writing, one more step is needed. Don't stop at “this is good.” Write down “why it is good.” When you think about how this sentence met your situation, which word stayed with you, and how you would write it differently, collecting sentences becomes writing practice.</p>
<p>In professional writing, this process resembles building a database of taste. Looking at which sentences you choose again and again shows the rhythm, logic, mood, and imagery you prefer. People who write well do not write by vague instinct alone. They know which sentences they respond to and turn that response into a standard for their own sentences.</p>
<h2>Recording Is the Process of Carrying Read Sentences into Your Own Life</h2>
<p>Between copying out a sentence you read and writing your own thoughts, there is an important step. That step is recording. Recording is the process of carrying someone else's sentence into your own life. When a sentence stays with you, writing down which part of your experience it touched turns reading, bit by bit, into writing.</p>
<p>Say, for example, you liked one sentence in a novel. Sharing that sentence as it is has meaning too. But if you don't stop at “I liked this sentence” and write “why did I need this sentence now?”, the writing changes. The book's sentence connects to your memories, relationships, and worries. Then the reader is not a mere consumer but someone who interprets.</p>
<p>A good record doesn't need to be long. Three sentences are fine. What matters is whether your own judgment enters. When the reason you chose the sentence, the parts you agree or disagree with, and the scene that came to mind from your life are written together, the record becomes deeper than a simple impression.</p>
<p>Here the heart of writing is not a fine conclusion but an accurate connection. Don't force the book's sentence and your experience together; find the point where they actually meet. When you move from the feeling “this sentence is good” to “what did this sentence explain to me?”, a reading record becomes the seed of a short essay.</p>
<h2>Blogs and Long Records Become a Space of One's Own Again</h2>
<p>The stronger short-form social media grows, the more special the place for long records becomes. On fast platforms, a sentence and an image spread easily, but thought needs a somewhat longer space to accumulate. So text hip connects not only with transcription and sentence sharing but also with the revival of long records such as blogs, newsletters, and reading notes.</p>
<p>The KB Financial Group Research Institute analyzed that the text hip trend is bound up with the desire to record and share your own thoughts and daily life.<sup>2</sup> This is important. Writing in text hip does not necessarily aim at publication. It includes writing to hold your life in language, to save what you read so it isn't forgotten, and to connect with other people.</p>
<p>A long record stores your thinking. You can write down a sentence you liked today, explain why you liked it, and reread it a few days later and revise your thinking. This differs from writing meant to get an instant reaction. A long record is writing you leave for yourself first, before showing it to anyone else.</p>
<h2>Writing in Text Hip Is Closer to Thinking Long Than Pretending to Write Well</h2>
<p>Writing in text hip also has a risk to guard against. If you focus only on making sentences look cool, the writing easily becomes a pose. Difficult words, sensuous sentences, and pretty notebooks are not the essence of writing. What matters in writing is what I saw, how I thought, and what words I can take responsibility for.</p>
<p>Good writing carries the trace of long thought more than a polished image. Even a short impression gains force if it connects to your own experience. Conversely, even with many splendid expressions, writing without real thought has trouble being read for long. For text hip to deepen into a writing culture, honest sentences must matter more than fine ones.</p>
<p>In this respect, text hip can meet writing classes well. Rather than asking for a finished essay from the start, you can build a process of choosing good sentences, transcribing, writing why this sentence stayed with you, and rewriting it with your own experience. Writing becomes not a place to prove talent but a process of slowly drawing thought out.</p>
<h2>In the Age of AI, Recognizing Your Own Sentences Matters More</h2>
<p>Generative AI makes writing quickly. It can produce impressions, recommendation pieces, and blog drafts. Then will transcription and recording matter less? They may matter even more. The more easily AI makes sentences, the more you need the ability to tell the sentences you truly like from the sentences you can take responsibility for.</p>
<p>Transcription and reading records build standards for your own sentences. You come to know what rhythms you like, what explanations you feel you can trust, and what exaggerations you dislike. With these standards, you can also fix the sentences AI makes. Someone without standards easily mistakes a natural-sounding sentence for a good one.</p>
<p>Writing in the age of text hip is not writing that refuses AI. It is training so as not to lose your own voice amid the average sentences AI makes. The process of reading, choosing, copying out, and turning it back into your own words will remain an important foundation of writing from here on.</p>
<p><small>1: Korea Press Foundation, materials on the “Text Hip Trend.” Introduces the trend in which text hip expands into writing hip, a transcription craze, with online mentions of transcription clubs up 1.6 times compared with 2021.<br>2: KB Financial Group Research Institute, “A Lasting Resonance Through Writing: The Power of Text” (June 30, 2025), and the KDI Economic Information Center summary. Analyzes text hip as connected to the desire to record and share, and to changes in the markets for bookstores, reading subscription platforms, social media, and reading goods.<br>3: Ministry of Culture, Sports and Tourism, press release on the “2025 National Reading Survey” (Mar. 6, 2026). Reference data for checking changes in reading rates and the reading environment.</small></p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>Text hip grows not only reading but also a writing culture of transcription, sentence collecting, and reading records.</li>
<li>Transcription is writing with the lowest threshold, reducing the burden of the blank screen and letting you feel the rhythm of good sentences.</li>
<li>Collecting sentences is a process of discovering your own taste and questions, and becomes writing practice when you write down “why it is good.”</li>
<li>Recording is the process of carrying someone else's sentence into your own life, and it becomes the foundation of longer writing.</li>
<li>In the age of AI, the ability to recognize and take responsibility for your own sentences amid many sentences matters more.</li>
</ul>]]></description>
      <category>texthip</category>
      <pubDate>Fri, 26 Jun 2026 04:14:21 GMT</pubDate>
    </item>
    <item>
      <title>Why Human Writing Matters More in the Video and AI Age</title>
      <link>https://opkle.app/abstract/blog/writing/human-writing-in-video-ai-age?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/writing/human-writing-in-video-ai-age?lang=en</guid>
      <description><![CDATA[<p>Video keeps getting stronger, and AI makes sentences more and more naturally. In the 2024 broadcast media usage survey, overall OTT (streaming service) usage was 79.2%, and 75.3% named the smartphone as an essential medium in daily life.<sup>1</sup> Experience with generative AI is also spreading fast.<sup>2</sup> So will human writing matter less? On the surface it may look that way. You can explain with video, hand the first draft to AI, and read long pieces as summaries. In reality, though, the opposite happens. The more an age is one of video and AI, the more human writing matters.</p>
<p>The reason is simple. The more tools there are, the more important the ability to decide what to say becomes. Video, too, needs planning, a script, and a structure for its message. AI also produces entirely different results depending on the user's questions, judgment, and editing standards. The Stanford AI Index 2025 shows that organizations around the world are using AI at a fast-growing pace, but amid exactly that spread, the role of the people who review the results and take responsibility for them grows more important.<sup>3</sup> Writing is the craft of thought that lies beneath all of this work.</p>
<p>Writing well is not only the ability to make pretty sentences. It is the ability to define a problem precisely, organize information, imagine the reader, and build an order of judgment. People with this ability can also make better video, handle AI better, and convey their thinking more persuasively.</p>
<p>1. We look at why writing remains the backbone of content even in the age of video.</p>
<p>2. We think about how, the more sentences AI makes, the more human judgment and editing matter.</p>
<p>3. We find out why writing ability extends into planning, persuasion, creation, and competitiveness at work.</p>
<p>4. We sum up the role of writing that remains for people from here on.</p>
<h2>Video Also Starts from Writing</h2>
<p>Video is made of images and sound, but at the bottom of good video there is writing. The planning that decides what to say, the composition that decides in what order to show it, the script that connects scenes, the title and description, even the thumbnail text all touch the realm of writing. Even a video that explains by speaking moves along an invisible structure of writing. Especially with content where the reader's understanding and trust matter, such as educational video or brand content, the structure of the message has to stand before the screen does.</p>
<p>When a video doesn't get its message across, the problem is often not only filming technique. If the message is blurry, if the question promised in the introduction goes unanswered in the body, or if the order of examples and conclusion is off, the video loses its force. However dazzling the screen, if the structure of thought is weak, the viewer will not stay long.</p>
<p>So in the age of video, writing does not disappear. It moves behind the scenes. It is merely not visible in front of the screen, and remains as the language of planning and composition. Someone who can write well can also build a better order of thought for good video. Video is not a replacement for writing but a place where writing ability extends into another form.</p>
<p><strong>Writing Hidden Inside Video</strong></p>
<ul>
<li>It sets the central question and message of the video.</li>
<li>It arranges scenes and information in an order the viewer can follow.</li>
<li>It adjusts the tone of the title, description, captions, and script.</li>
<li>It designs the thought or action that remains after the video ends.</li>
</ul>
<h2>AI Makes Sentences but Does Not Take Responsibility for Purpose</h2>
<p>AI makes sentences quickly. It suggests titles, writes drafts, summarizes, and recasts text in a different tone. This ability is impressive and useful. But that AI makes sentences does not mean it takes responsibility for the purpose of the writing. Judging what should be said, how far you can go, and which expressions would mislead the reader still remains with people. A survey result showing that efficiency of information search ranked high among motives for using generative AI also shows that people are using AI as an aid to quick judgment.<sup>2</sup></p>
<p>If you ask AI vaguely to “write something good,” out comes a plausible, average sentence. But professional writing is not satisfied with average sentences. It needs the reader's situation, the purpose of the writing, the evidence to be stated, the exaggeration to be avoided, and the voice to be kept. Someone without such standards finds it hard to evaluate what AI returns.</p>
<p>People with writing ability use AI differently. They do not take a finished version. They form the questions, break the draft apart, look for missing evidence, and adjust the tone of the sentences. AI becomes not something that writes in your place but a tool that extends the writer's judgment.</p>
<h2>Good Writers Make Good Questions</h2>
<p>Good writing begins with good questions. It is the ability to ask what you are trying to explain, where the reader gets stuck, what evidence this claim needs, and which misunderstandings to avoid. When these questions are clear, the writing doesn't waver. Conversely, if the questions are blurry, no number of sentences will give it a center.</p>
<p>In the age of AI, this ability to question matters more. AI follows the direction of the question the user throws. If the question is shallow, the answer is shallow, and if the standards are blurry, so are the results. A good prompt is not a mere command. It is a good writing question turned into a form the tool can understand.</p>
<p>So someone who writes well is likely to handle AI well. They know what to ask, how to read the answer, and how to fix the result to suit their own purpose. In the end, the depth of skill in using AI meets the depth of writing.</p>
<p><strong>The Difference Good Questions Make</strong></p>
<ul>
<li>They turn a vague subject into a concrete problem.</li>
<li>They reflect the reader's level and situation in the result.</li>
<li>They separate the claims that need evidence from the sentences that only need polishing.</li>
<li>They build the standards for evaluating what comes out and asking again.</li>
</ul>
<h2>Writing Is the Ability to Build an Order of Judgment</h2>
<p>Much work resembles writing. Business plans, course design, product introductions, lecture scripts, customer guides, team meeting documents, and brand messages all have to convey thought in order. What is needed then is not merely skill with sentences. It is the ability to judge what to say first and what later, what evidence to show and which expressions to cut.</p>
<p>Video and AI can help with this process, but they do not take responsibility for the order. Tools make material quickly and show many possibilities. But someone has to judge which of those possibilities fits the present purpose. Writing is exactly the training for that judgment.</p>
<p>People who have written for a long time are sensitive to the order of thought. They don't throw out words the reader doesn't yet know, don't leap to a conclusion without evidence, and don't pass too quickly over important scenes. This sense also works outside of writing. Good writing ability is good communication ability, good planning ability, and good editing ability.</p>
<h2>Human Writing Moves to the Seat of Responsibility</h2>
<p>From here on, AI will make more sentences. In that case, human writing may gradually shift away from producing every sentence from scratch. The more important role will be setting the purpose, establishing standards, reviewing the results, and choosing the sentences to leave under your own name. An age is coming when the ability to take responsibility for sentences matters more than the speed of producing them.</p>
<p>This change does not mean the value of writing is shrinking. It means the center of writing is becoming clearer. Simple production of sentences can be helped by tools, but which sentence is needed now, which words one cannot take responsibility for, and to which reader and in what order to hand things over remain human judgments.</p>
<p>In the age of video and AI, human writing moves to a deeper place. It moves from the skill of making visible sentences to the ability to make invisible standards and responsibility. Someone who can write well does not lose the initiative over their own thinking even in front of a new tool.</p>
<p><small>1: Korea Communications Commission and Korea Association for ICT Promotion, results of the “2024 Broadcast Media Usage Survey.” Smartphone recognized as an essential medium: 75.3%; overall OTT usage: 79.2%.<br>2: Korea Media and Communications Commission and Korea Information Society Development Institute, results of the “2025 Intelligent Information Society User Panel Survey.” Experience using generative AI: 38.9%; efficiency of information search as a main motive: 86.0%.<br>3: Stanford Institute for Human-Centered AI, “AI Index Report 2025.” Covers the spread of AI use by organizations worldwide in 2024 and the increase in generative AI investment.</small></p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>Even in the age of video, planning, composition, scripts, and titles and descriptions need writing ability.</li>
<li>AI can make sentences, but it cannot judge for you the purpose, evidence, and responsibility of the writing.</li>
<li>People who write well can form good questions, evaluate AI's results, and re-edit them in the direction they need.</li>
<li>From here on, human writing will matter more as the ability to set standards and take responsibility than as sentence production.</li>
</ul>]]></description>
      <category>writing</category>
      <pubDate>Thu, 25 Jun 2026 02:27:02 GMT</pubDate>
    </item>
    <item>
      <title>Reading and Writing Amid YouTube and AI</title>
      <link>https://opkle.app/abstract/blog/writing/reading-and-writing-crisis-today?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/writing/reading-and-writing-crisis-today?lang=en</guid>
      <description><![CDATA[<p>People today see far more sentences than before. Search results, captions, comments, notifications, summaries, card news (a swipeable series of image cards), and short messages in chat apps pass before our eyes all day long. Strangely, though, the time we spend reading long pieces feels as if it has shrunk. In the Ministry of Culture, Sports and Tourism's 2025 national reading survey, the annual overall reading rate for adults came to 38.5%, which was 4.5 percentage points lower than in the 2023 survey.<sup>1</sup> There are more words, but reading that follows a single thought for a long time has become harder. This is why people say reading books and writing have met a crisis in an age when YouTube, short-form video, and AI summary tools have become familiar.</p>
<p>But this crisis cannot be explained simply as people having grown lazy. When the medium changes, the way we focus changes too. In the 2024 broadcast media usage survey, 75.3% of respondents named the smartphone as an essential medium in daily life, and overall OTT (streaming service) usage came to 79.2%.<sup>2</sup> Video shows complex content quickly, algorithms keep handing us the next interest, and AI compresses long writing into a few lines. In this environment, people more often use the ability to grasp things fast than the ability to read deeply.</p>
<p>The problem is that reading and writing are not merely ways of getting information. Reading a long piece means following another person's thoughts at a pace slower than your own, and writing means turning scattered experience and judgment into one order. When this ability weakens, even as information grows, thought can easily turn shallow.</p>
<p>1. We look at why long reading has become harder in the age of video and AI.</p>
<p>2. We think about why reading books and writing mean more than simply acquiring information.</p>
<p>3. We find out how a quick summary differs from deep understanding.</p>
<p>4. We view today's crisis of writing as a need for new training.</p>
<h2>We See Many Words but Do Not Read for Long</h2>
<p>The digital environment did not make words disappear. On the contrary, there are more of them. Videos have captions, Shorts have titles and comments, and search results and notifications call to us in short sentences. The problem is not the amount of text but the way of reading. Reading that skims briefly, reacts right away, and moves on to the next screen has increased.</p>
<p>Reading a long piece asks for a different kind of time. You enter slowly at first, remember the earlier content in the middle, and near the end see how the opening question has changed. This process is slower than instant stimulation, and sometimes dull. But thought deepens within that slowness. Writing does not throw information at the reader. It lets them experience how a thought grows.</p>
<p>Today's reading crisis does not come from a lack of words. It comes from the weakening of our power to stay with a single thought amid too many short pieces and fast screens. A Korean Publishers Association press release on its 2024 reading culture statistics also says that time spent watching video platforms is about 2.8 times longer than reading time on weekdays and about 3 times longer on holidays.<sup>3</sup> Reading books and long pieces is therefore not an old hobby but training that protects time for thought in a distracted age.</p>
<p><strong>Strengths That Long Reading Asks For</strong></p>
<ul>
<li>Remembering what you read earlier and connecting it to the sentences that follow.</li>
<li>Following the process by which thought changes rather than an instant conclusion.</li>
<li>Staying a little longer before words you don't know and claims that make you uncomfortable.</li>
<li>Allowing time for understanding before a quick reaction.</li>
</ul>
<h2>Video Aids Understanding but Does Not Replace Thinking</h2>
<p>Video is a powerful medium. It shows complex scenes at a glance and aids understanding through voice and expression, images and music. What would take a long written explanation, video can convey in a short time. So in learning and explanation, promotion and record keeping, video has already become an important language.</p>
<p>But video does not replace all thinking. Video flows. Viewers follow the scenes at a set pace, and algorithms quickly suggest the next video. You can of course pause and rewatch, but the basic feel of video is closer to time passing. With writing, by contrast, the reader controls the speed. You can stop at a sentence, go back to an earlier paragraph, and insert your own thoughts.</p>
<p>So video and writing are not only in competition. Video opens the entrance to understanding, and writing can slowly refine the inside of a thought. The problem is the moment you feel that video alone is enough. Even content that seemed easy to understand shows its gaps when you try to explain it again in writing. Writing is one of the oldest ways of checking whether you truly understood.</p>
<h2>AI Summaries Are Convenient but Can Shorten the Time for Understanding</h2>
<p>AI summarizes long pieces quickly. It is a great help in tidying up a difficult document, pulling out key items, and turning complex content into easy words. In the 2025 intelligent information society user panel survey by the Korea Media and Communications Commission and KISDI (the Korea Information Society Development Institute), 38.9% of respondents had used generative AI, and efficiency of information search ranked highest among the main motives.<sup>4</sup> Such features are certainly useful. They are a good starting point especially when you have to skim a lot of material or get the overall outline of an unfamiliar field.</p>
<p>But reading a summary differs from reading the writing. A summary shows the conclusion and core quickly, but it can cut the deliberation, context, exceptions, and hesitations that lead to that conclusion. In a long piece, what matters is not only the final conclusion. You should also read in what order the writer led the reader, what evidence they chose, and which expressions they were careful with.</p>
<p>To use AI summaries well, treat a summary as an entrance, not an end. First grasp the big direction, then go back to the original for the important passages. Especially with writing that calls for judgment, or where context matters, such as literature and criticism, history and social issues, it is better not to think you have understood from a summary alone.</p>
<p><strong>The Difference Between Summary and Understanding</strong></p>
<ul>
<li>A summary shows the core quickly but shortens the process of thought.</li>
<li>The original shows the evidence, exceptions, the distance of sentences, and the writer's attitude together.</li>
<li>A summary can be an entrance, but the final judgment needs checking against the original.</li>
<li>Deep understanding comes from reading the road to the conclusion rather than the conclusion.</li>
</ul>
<h2>Writing Is the Art of Slowing Thought Down</h2>
<p>Writing is not transferring the thoughts in your head just as they are. As you write, your thinking changes. What you vaguely believed you knew won't come out as sentences, a strongly felt emotion cannot find its grounds, and gaps appear between plausible claims. Writing slows thought down and, in that slowness, lets you examine it.</p>
<p>The more an age is one where video and AI help us understand fast, the more important this slowness becomes. Fast tools bring results sooner, but they do not remove responsibility for judgment. Checking what I know and don't know, which things I cannot say yet, and what evidence is needed is still a person's job. Writing is the training that makes that checking possible.</p>
<p>Someone who writes well is not merely someone with good sentences. It is someone who holds on to their own thoughts, rearranges their order, and organizes them enough to hand to a reader. So writing is not an outdated skill in the age of video. It is, rather, a slow art for not losing your thinking in an age that is too fast.</p>
<h2>The Crisis of Reading and Writing Calls for New Distinctions</h2>
<p>Today's crisis cannot be solved by simply taking sides between writing and video, or between people and AI. Video can be a good entrance to learning, and AI can be a great help with organizing material and drafting. What matters is distinguishing what to process quickly from what a person should read and write to the end.</p>
<p>For checking brief information, a summary may be enough. But matters that need deep context, such as the direction of a life, the standards of creation, another person's experience, and social judgment, call for slower reading and writing. You don't need to read everything at length, but you do need the strength to read important things at length. You don't need to leave every thought in writing, but you do need the strength to put important judgments into writing.</p>
<p>So reading books and writing connect not to a habit of the past but to discernment in the future. Someone who knows what may be passed over quickly and what calls for a stop is not tossed about even when they meet a better tool. The power to read and write is the power to judge slowly in a fast age.</p>
<p><small>1: Ministry of Culture, Sports and Tourism, press release on the “2025 National Reading Survey” (Mar. 6, 2026). Annual overall reading rate: adults 38.5%, students 94.6%; adults down 4.5 percentage points from 2023.<br>2: Korea Communications Commission and Korea Association for ICT Promotion, results of the “2024 Broadcast Media Usage Survey.” Smartphone recognized as an essential medium: 75.3%; overall OTT usage: 79.2%.<br>3: Korean Publishers Association, press release on the “2024 Reading Culture Statistics” (Sept. 8, 2025). Notes that time spent watching video platforms is about 2.8 times longer than reading time on weekdays and about 3 times longer on holidays.<br>4: Korea Media and Communications Commission and Korea Information Society Development Institute, results of the “2025 Intelligent Information Society User Panel Survey.” Experience using generative AI: 38.9%; efficiency of information search as a main motive: 86.0%.</small></p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>People today see many words, but reading that follows a long piece for a long time is getting harder.</li>
<li>Video can open the entrance to understanding, but writing lets the reader refine thought at their own speed.</li>
<li>AI summaries are a useful starting point, but deep understanding comes from reading the original and the process of thought.</li>
<li>Writing is training that slows thought down in a fast age and lets you confirm important judgments for yourself.</li>
</ul>]]></description>
      <category>writing</category>
      <pubDate>Thu, 25 Jun 2026 02:27:02 GMT</pubDate>
    </item>
    <item>
      <title>Text Hip and Reading&apos;s Comeback</title>
      <link>https://opkle.app/abstract/blog/writing/text-hip-and-return-of-reading?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/writing/text-hip-and-return-of-reading?lang=en</guid>
      <description><![CDATA[<p>For a while, reading books seemed like a slow, old-fashioned hobby. Video is faster, search is easier, and AI summarizes long content for us. Yet in exactly such an age, a trend appeared in which books and sentences, copying out passages by hand, and book clubs came to be embraced as a cool taste. This phenomenon, which Koreans commonly call <strong>text hip</strong>, is a more interesting signal than a mere buzzword. The advertising and trend industries and the press also treat this trend as books, sentences, transcription, and book clubs reappearing as a language of taste.<sup>1</sup></p>
<p>Text hip is a coinage that combines “text” with the sense of being hip, or cool. It points to a trend in which reading books, collecting sentences, and engaging with long texts show up as a taste and a style. People photograph book covers, share lines they love, and express who they are through book clubs and handwritten transcription. A flow similar to the BookTok culture abroad, where books and reading experiences circulate again on video and image platforms, is also observed.<sup>2</sup> Books no longer stay only as objects read quietly alone. They become a cultural scene that shows one's taste.</p>
<p>This trend is interesting because it looks like a reaction that arose in the age of video and AI. The faster everything gets, the newer slow things feel, and the more images overflow, the more special sentences become. At the same time, the reading rate itself is falling. In the 2025 national reading survey, the annual overall reading rate for adults was 38.5%.<sup>3</sup> So rather than declaring text hip a full revival of reading, it is more accurate to read it as a mixed sign that, even amid a lower reading rate, people want long thought and quiet taste again.</p>
<p>1. We look at why text hip appeared in the age of video and short-form content.</p>
<p>2. We think about the shift in which reading books became a way of revealing taste and identity.</p>
<p>3. We find out the possibilities and limits of text hip together.</p>
<p>4. We sum up what this trend means for writing today and for creators.</p>
<h2>In a Fast Age, Slow Things Become New</h2>
<p>Culture never moves in only one direction. As fast video increases, it seems that only faster video will remain, but at some point people look at slow experiences with fresh eyes. In an environment where everything plays instantly and is skipped instantly, opening a book and staying with one sentence becomes a special attitude.</p>
<p>Text hip has this character of reaction. If reading a book were only a way of getting information, video and summary tools might be more convenient. But a book gives more than information. Together come the time of holding a book, the taste of choosing sentences, the self-image of someone who reads at length, and the relationship of sharing impressions with others. It is the moment when slowness becomes a style rather than an inconvenience.</p>
<p>This change is not simply a story of young people suddenly reading many books. More important is that reading books has become a taste you can talk about again. Reading, once a quiet personal matter, has become a culture shared with photos, gatherings, records, recommendations, and transcription. The flow of shrinking amounts of reading and the flow of growing symbolism of reading appear at the same time.</p>
<p><strong>Why Slow Reading Feels New</strong></p>
<ul>
<li>The more fast screens there are, the more behavior that lingers stands out.</li>
<li>Books become objects that show taste and attitude as well as information.</li>
<li>Choosing and recording sentences becomes a way of self-expression.</li>
<li>Reading is both a solitary time and a culture that can be shared.</li>
</ul>
<h2>Books Became Objects That Show Taste Again</h2>
<p>Books have long been a symbol of knowledge and refinement. But in today's text hip, books appear in a somewhat different way. More important than the fact of reading is which book you choose, which sentence you underline, and in what space you read. Reading is both an accumulation of knowledge and an expression of taste.</p>
<p>There is a positive side to this trend. Books come back into people's everyday language. Recommending a line to a friend, visiting an independent bookstore, joining a book club, and recording the books you've read turn a book from an isolated object into an experience within relationships. A book once read alone becomes a starting point for conversation.</p>
<p>Of course, reading as taste also risks being consumed lightly. You may want to leave behind only the image of reading rather than the reading itself, and the mood of a photo may come before the meaning of a sentence. But this risk is no reason to take the whole trend lightly. Some people enter a book through an image and then begin deeper reading within the actual sentences. The entrance to a culture can always be a little superficial, but a good entrance leads people inside.</p>
<h2>Text Hip Can Be an Entrance to Reading</h2>
<p>Not all deep reading begins deep. Someone buys a book because of its cover, someone reads because a person they like recommended it, someone opens a whole volume drawn by one short sentence. Text hip can widen such entrances, because it turns books from difficult, solemn objects into something you can meet within your current tastes and life.</p>
<p>Entrances matter especially for people who have long been away from books. If reading remains a memory of exams and homework, opening a book again takes a small occasion. A pretty bookstore, a short transcription, a book club with friends, or a line left on social media can be that occasion. Even if it looks light at first, that lightness can lead to a habit of reading again.</p>
<p>A good reading culture lowers the entrance without leaving the inside empty. It must not stop at presenting books as a cool taste. It has to lead to a place where people really read, think, and talk. For text hip to last, it has to arrive not at the image of books but at the experience of sentences.</p>
<p><strong>Conditions for Being a Good Entrance</strong></p>
<ul>
<li>It lets people feel books as a close experience rather than a difficult, distant object.</li>
<li>Sharing sentences should be able to lead to actual reading and conversation.</li>
<li>Expressing taste should lead to expanding thought.</li>
<li>It should respect the time of reading more than the image of consuming books.</li>
</ul>
<h2>Reading That Starts as Style Can Deepen Too</h2>
<p>Some people see text hip and worry that reading is becoming too much an image. They worry that books become background props, sentences become decorations of self-expression, and looking like a reader may come before actual reading. This criticism is partly valid. Any culture, once it becomes a fad, risks keeping only its surface.</p>
<p>But something that begins as style does not necessarily end shallow. Many hobbies and studies begin in mood and curiosity. What matters is what comes next. The depth varies with whether you actually read after photographing a book beautifully, whether you think about why a line stayed with you after sharing it, and whether you hear others' impressions at a book club and try changing your own thinking.</p>
<p>Writing and reading always have both an entrance and an inside. Covers, titles, bookstores, recommendations, and fads can be entrances. But good reading passes through that entrance and goes inside the sentences. We need an attitude that treats text hip not merely as a light fad but as a passage through which people can come back into sentences.</p>
<h2>For Writers, Text Hip Is an Important Signal</h2>
<p>Text hip means something for writers, too. People still want sentences. It is only that the way they meet sentences has changed. There are not only readers who read a book from start to finish. There are also readers who come in through one sentence, through a recommendation, through a short video or a photo. Writers cannot ignore these entrances.</p>
<p>That does not mean writing must be made light to fit fashion. In fact, the lighter the entrance, the sturdier the inside must be. A title and a sentence can call a reader, but what keeps them there is the depth and trustworthiness of the writing. In the age of text hip, good writers must think together about sentences that can be discovered and a structure that can be read for a long time.</p>
<p>This trend is also evidence that books and writing have not disappeared. People are still looking for sentences that speak for their thoughts, books that explain their taste, and texts they can share with others. Even in the age of video and AI, sentences do not vanish but reappear in another way. What matters is making those sentences not end as light markers but lead to real reading and writing.</p>
<p><small>1: Cheil Magazine, “The Age of Text Hip, Containing Taste.” Explains text hip as a combination of text and hip, covering the trend of books, sentences, transcription, and book clubs rising as a taste culture.<br>2: The Korea Herald, “Text Hip: BookTok drives Gen Z reading craze in Korea” (Apr. 28, 2025). Reports on the phenomenon of younger generations' reading experiences recirculating through BookTok and social media.<br>3: Ministry of Culture, Sports and Tourism, press release on the “2025 National Reading Survey” (Mar. 6, 2026). Annual overall reading rate: adults 38.5%, students 94.6%.</small></p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>Text hip is a trend in which books and sentences have risen again as a taste in the age of video and fast screens.</li>
<li>Reading books is expanding beyond acquiring information into self-expression, relationships, and cultural experience.</li>
<li>Text hip carries the risk of superficial consumption, but also the possibility of becoming a new entrance to reading.</li>
<li>For writers, this trend is an important signal that people still want good sentences and deep texts.</li>
</ul>]]></description>
      <category>writing</category>
      <pubDate>Thu, 25 Jun 2026 02:27:02 GMT</pubDate>
    </item>
    <item>
      <title>Good Writers Hold the Edge in the New Era</title>
      <link>https://opkle.app/abstract/blog/writing/writing-as-future-competency?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/writing/writing-as-future-competency?lang=en</guid>
      <description><![CDATA[<p>Competitiveness in the new era does not come simply from knowing many tools. The ability to use certain programs or certain AI services is important, but it is not enough on its own. As experience with generative AI widens and AI use spreads fast among companies and organizations, more people have access to similar tools.<sup>1</sup> The stronger the tools become, the more people need the ability to set direction, form questions, and judge results. Writing lies at the base of that.</p>
<p>People who write well can organize their thoughts. They break a complex problem apart, separate the important from the less important, and rearrange it in an order the reader can understand. This ability is not needed only when writing a manuscript. It works the same way when designing a course, explaining a product, persuading a team, or handing a job to AI.</p>
<p>The competitive person of the future will not be simply someone who gives AI good commands. It will be someone who has standards of their own thinking and can read, fix, and take responsibility for what tools produce. Such a person has likely trained the shape of their judgment through writing. Even the ability to write a good prompt starts, in the end, from the ability to define a problem precisely and to explain in words the standards of the result you want.</p>
<p>1. We look at why writing ability is becoming a basic competency of the new era.</p>
<p>2. We find out how simple prompt entry differs from AI use grounded in deep writing.</p>
<p>3. We think about how writing ability extends into work, creation, education, and business.</p>
<p>4. We sum up what kind of writing ability the person needed in the future should have.</p>
<h2>People with Standards Matter More Than People Who Use Tools</h2>
<p>New tools keep appearing. A service familiar today changes tomorrow, new features are added, and faster, easier ways emerge. So the ability to learn only how to use something may not last long. What matters is the standard that remains even when tools change: the power to judge what you want to make, whom it is for, and what counts as a good result.</p>
<p>Writing trains this standard. To write, you have to set a purpose, imagine the reader, choose evidence, and set up the order of sentences. This process is needed regardless of tools. People with writing ability ask first even when they meet a new tool. What can I think more precisely with this tool? What can I convey better? From where on do I have to judge?</p>
<p>In the future, the ability to use tools will be basic for many people. What makes the difference is the standard by which you read what the tools produce. People who write well hold that standard in words. So they can form better questions, choose more accurate results, and send them into the world in a more responsible form. In an age when everyone uses similar tools, the eye that judges results makes a bigger difference than the tools themselves.</p>
<p><strong>Questions Asked by Someone with Standards</strong></p>
<ul>
<li>Who needs this result?</li>
<li>Do the main claim and its evidence fit together?</li>
<li>Is any context missing, or any expression exaggerated?</li>
<li>Am I comfortable publishing this sentence under my name?</li>
</ul>
<h2>A Prompt Is Only One Part of Writing</h2>
<p>When people talk about using AI, prompts are often emphasized. Learning what sentence to enter to get a good answer, what role to assign, and in what format to make a request is certainly helpful. But a prompt is not the whole of writing. It is a part.</p>
<p>A good prompt comes from a good writing question. Your request improves when you know who the reader is, what the purpose of the writing is, what evidence is needed, what tone is suitable, and which expressions to avoid. Without these standards, a prompt grows longer but not deeper. There may be many commands and an empty judgment. As more people use generative AI for information search and document work, this difference will become clearer.<sup>2</sup></p>
<p>People who write well do not use prompts like spells. Before handing a job to AI, they organize the problem. After receiving the result, they read the sentences, look at the structure, check the evidence, and revise it again to fit their own purpose. A prompt is only the starting point of this whole process.</p>
<h2>People Who Write Well Can Edit What AI Produces</h2>
<p>What AI produces is generally plausible. The sentences are natural, the structure looks tidy, and the conclusion closes calmly. This is exactly what makes it both convenient and dangerous, because it is easy to mistake a plausible result for a good one. People who write well do not stop here.</p>
<p>As they read the sentences, they ask: Is the center of this piece clear? Is it in the order the reader needs? Is there any assertion without evidence? Is it dodging responsibility with sentences that are too general? Such questions come more naturally to people who have written. Someone who has written knows that a first draft is not a finished version.</p>
<p>The ability that will matter from here on is not only getting results from AI quickly. It is the editing ability to take those results apart and put them back together. People who write well keep AI's sentences under their own judgment. They take the tool's speed, but leave the final standard with a person. This is not an argument for using AI less. It is an argument that we need human standards of writing in order to use it better.</p>
<p><strong>Standards for Editing AI Results</strong></p>
<ul>
<li>Check that the central question has not blurred.</li>
<li>See that the background and exceptions the reader needs are not missing.</li>
<li>Mark sentences that are natural but have no evidence.</li>
<li>Rewrite to fit your own voice and purpose.</li>
</ul>
<h2>Writing Extends into the Ability to Explain Every Kind of Work</h2>
<p>Writing is not an ability only for authors and reporters. Almost all work needs explanation. You have to say why this product is needed, what someone gains from taking a given class, what problem this feature solves, and why the team should go in this direction. When the explanation is weak, even a good idea does not get across.</p>
<p>People who write well can build their work in words. They turn a vague idea into sentences, unpack a complex feature in the reader's language, and arrange the evidence in the order the person they must persuade needs. This is not a matter of writing good marketing copy. It is the ability to make your own thinking and work understandable and usable by others.</p>
<p>In the age of AI, this ability grows. Many people can use similar tools and produce similar outputs. The difference arises in what problem you explain the result as solving, and what meaning you hand it to which reader with. Writing becomes the basic language for showing the value of work. The faster technology makes outputs, the more important the ability of the person who explains why those outputs are needed.</p>
<h2>The Person of the New Era Reads, Writes, and Edits</h2>
<p>The competitive person of the future will not be only someone who consumes fast. It will be someone who reads well, writes well, and edits well. They do not stop at gathering a lot of information. They work out what meaning that information holds. They do not accept what others have made as it is, but reread it by their own standards.</p>
<p>This person neither fears nor blindly trusts AI. They hand over what the tool does well, but know what they themselves must judge. They can produce a draft quickly, but they also know that the draft is not enough. They can receive a summary, but before an important judgment they go back to the original and its context.</p>
<p>In the end, competitiveness in the new era is the ability to handle speed and depth together. Someone who starts fast but reviews deeply, who uses tools without losing their own thinking, who turns what they want to say into a form the reader can understand. For such a person, writing is not an extra skill but a core competency.</p>
<h2>Writing Is the Operating System of Your Own Thinking</h2>
<p>If you see writing only as a skill of expression, its importance looks small. But writing is a way of operating thought. It is the process of deciding what to input, what to discard, in what order to process it, and what result to send out. Someone who writes good pieces can, to some degree, see the structure of their own thinking.</p>
<p>AI and new media make this operating system all the more necessary. The more results tools make for us, the more people have to judge. We must decide what to trust, what to fix, what to publish, and what more to ask. Writing trains this judgment in language.</p>
<p>So writing will not disappear in the future. Rather, it will become the ability that sets people apart amid more tools and more content. People who write well can handle their own thoughts, read other people's thoughts, and edit what tools produce to fit their own purpose. Such a person is the competitive person of the new era.</p>
<p><small>1: Stanford Institute for Human-Centered AI, “AI Index Report 2025.” Covers the spread of organizations' AI use in 2024 and the increase in generative AI investment.<br>2: Korea Media and Communications Commission and Korea Information Society Development Institute, results of the “2025 Intelligent Information Society User Panel Survey.” Experience using generative AI: 38.9%; motives for use include information search efficiency and document writing.</small></p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>Competitiveness in the new era comes not only from knowing how to use tools but from the ability to set standards and judge results.</li>
<li>A prompt is part of writing, and a good prompt begins with a good writing question.</li>
<li>People who write well can read AI's results, take them apart, and re-edit them to fit their own purpose.</li>
<li>The competitive person of the future uses tools quickly yet also reads, writes, and judges deeply.</li>
</ul>]]></description>
      <category>writing</category>
      <pubDate>Thu, 25 Jun 2026 02:27:02 GMT</pubDate>
    </item>
    <item>
      <title>How Writing Standards Were Made</title>
      <link>https://opkle.app/abstract/blog/writing/history-of-writing-standards?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/writing/history-of-writing-standards?lang=en</guid>
      <description><![CDATA[<p>What we call good writing did not have its standards fixed from the start. In each era, people wrote for different reasons and read in different ways. In the age of the spoken word, memorable rhythm and the force of argument mattered. In the age of hand copying, preserving authoritative sentences mattered. After print spread widely, the order of sentences and the power of popular communication grew together. The standards of good writing were not born only inside sentences. They were made together with the ways writing travels.</p>
<p>Nor were the standards of writing made within literature alone. Courts and public squares, religion and schools, newspapers and publishing, advertising and web pages have all changed them. Writing has always been written in some social place, and each place wanted a different mix of accuracy, beauty, persuasiveness, and speed.</p>
<p>The standards we now voice, such as “be clear,” “think of the reader,” and “have evidence,” also came through a long history. In this article, we look at the broad flow of how the standards of writing have changed, and think about the old standards and new conditions between which writing stands today.</p>
<p>1. We look at the influence that the age of speech and rhetoric left on the standards of writing.</p>
<p>2. We find out how hand copying and print changed the authority and form of writing.</p>
<p>3. We think about how newspapers, magazines, and schooling grew the standard of clear writing.</p>
<p>4. We sum up why the standards of writing have been shaken and widened again in the digital age.</p>
<h2>The Standards of Writing First Grew from the Standards of Speech</h2>
<p>Before writing was widely read, thought was mostly passed along by speech. People spoke in the public square, persuaded in court, and learned by reciting in school. The important ability in that age was not simply knowing information but how to arrange it and convey it to those who were listening. That is why the roots of old writing lie in speaking and rhetoric.</p>
<p>Rhetoric is often misunderstood as flashy eloquence, but originally it was closer to an art of persuasion and an art of judgment. It asked in what order to speak so that the listener would follow, how to handle emotion and logic together, and how to establish the speaker's credibility. This remains in writing today. Winning the reader's attention in the introduction, arranging evidence in the body, and gathering the judgment in the conclusion are a legacy of the age of speech. That is also why good writing is not just noting down correct statements but making an order that someone can be convinced by.</p>
<p>Still, speech and writing differ. Speech vanishes in the moment, while writing is read again. So writing is examined longer than speech, travels farther, and meets the reader even where the writer is absent. The persuasive power of speech was an important starting point for writing, but over time writing began to build standards of its own.</p>
<p><strong>Standards Left by the Age of Speech</strong></p>
<ul>
<li>An introduction that wins the reader's attention is needed.</li>
<li>Thoughts should not be listed at random but arranged in the order of persuasion.</li>
<li>The writer's credibility and attitude matter as much as the content.</li>
<li>Emotion and logic are not separate. Together they move the reader.</li>
</ul>
<h2>In the Age of Hand Copying, Preservation and Authority Mattered</h2>
<p>Before print spread, books and documents were not easily duplicated. To keep writing and pass it on, someone had to copy it out by hand. In such an environment, writing was a far more precious thing than it is now. Being written down carried special meaning, and words worth preserving became documents.</p>
<p>The standards of writing in this period were closely tied to authority, depth, and form. Writing meant to be preserved for a long time, such as religious texts, laws, scholarly commentary, and historical records, valued accuracy and tradition. Writers were less completely free individuals than people who wrote within the order of earlier texts and authoritative language. Good writing had to do less with showing off novelty than with the ability to carry important words forward without damaging them.</p>
<p>Of course, these standards differ from those of writing today. We now live in an age when more people write more easily and share more quickly. Yet the standards of preservation and authority have not vanished entirely. Academic writing, legal documents, the proofreading and copyediting of publications, and the ethics of record keeping all still presuppose that writing can last a long time.</p>
<h2>Print Sent Writing to More Readers</h2>
<p>The art of printing greatly changed the standards of writing. Writing could be duplicated more and travel farther. Writers had to imagine a far wider readership than a nearby community or a particular authority. As books multiplied, readers gained the ability to choose, and writing needed a clearer structure and purpose to win the reader's time.</p>
<p>Print also changed the order of sentences. Devices such as titles, chapters, sections, page numbers, tables of contents, and footnotes became roads that helped readers follow long texts. Writing was no longer words you hear once and remember but a structure you can flip through, search, and reread. Alongside content, editing, arrangement, and the reader's convenience began to enter the standards of good writing. It mattered not only whether a sentence was good but where it sat within the whole book.</p>
<p>Printed writing also widened the arena of public debate. Books, pamphlets, and newspapers spread ideas through society, and writing gradually became not just the business of intellectuals and the powerful but of more and more people. The wider the readership writing reached, the more clarity and responsibility mattered. This is because writing that travels far has to be read on its own even where the writer cannot explain it in person.</p>
<p><strong>Changes Made by Print</strong></p>
<ul>
<li>Writing began to be written for more readers.</li>
<li>Devices for reading long texts, such as tables of contents, chapters, page numbers, and footnotes, became important.</li>
<li>Writing became a structure that could be reread and looked up.</li>
<li>The more widely it reached, the more clarity and responsibility writing needed.</li>
</ul>
<h2>Newspapers and Magazines Changed the Speed of Writing</h2>
<p>With the age of newspapers and magazines, writing began to be written faster and read faster. Readers met new events and opinions every day, and writers had to convey the essentials within limited space. This environment changed the length of sentences, the role of headlines, and the importance of the first paragraph. Readers had to be able to grasp the direction of a piece without long preparation.</p>
<p>This change did not only make writing shallower. Instead, styles that explained social events so many people could understand them, ways of quickly organizing complex information, and headlines and introductions that held the reader's interest all developed. Popularity and accessibility entered more strongly into the standards of good writing.</p>
<p>But speed brought danger with it. Writing done quickly can easily assert things and try to move the reader's feelings fast. So alongside accuracy, balance, and honesty between headline and body, such standards were required of newspaper and magazine writing. The fact that the faster a piece is read, the stricter its checking must be carries straight over to online writing today.</p>
<h2>Schools and Sentence Education Created Standards</h2>
<p>After the modern era, schooling spread the standards of writing widely. Standards such as spelling, paragraph breaks, introduction, body, and conclusion, and the relation between claim and evidence became the basic framework by which many people learned to write. This framework sometimes feels too stiff, but it played an important role in creating a common sense of writing.</p>
<p>School-style writing made writing evaluable. It made it possible to ask whether the subject was clear, whether paragraphs connected logically, whether there was evidence, and whether the expression was appropriate. This brought writing down a little from the realm of special talent alone, because the idea arose that anyone could learn certain standards and practice them.</p>
<p>Of course, if writing is locked inside the school framework, it can lose its vitality. Not every piece has to take the same shape of introduction, body, and conclusion. But learning the basic structure is still important. Someone who knows the form can keep to it when needed and depart from it consciously when needed.</p>
<h2>In the Digital Age, the Standards Widened</h2>
<p>The web and mobile environments shook the standards of writing once again. Writing is read not only as long sentences on paper but within search results, links, screen width, scrolling, notifications, comments, and sharing. Readers sometimes read a piece from start to finish, but they also enter looking for the part they need, or read while comparing with other pieces. Writing now stands alone and yet sits inside a network.</p>
<p>In this environment, titles and subheadings, the first paragraph, paragraph length, the placement of links, source citations, and readability on screen have all become important. Writing should be searchable, but should not deceive the reader for the sake of search. It should be skimmable, but also worth reading deeply. Good writing in the digital age has to find a balance between writing that is easy to discover and writing that can be trusted.</p>
<p>In the end, the standards of writing have kept changing. The persuasive power of speech, the preservation of copying, the structure of print, the speed of newspapers, the standards of schools, and the connectivity of the web all remain within writing today. Writing well does not mean memorizing this long history. It means knowing which standards the piece you are writing now descends from, and choosing those standards again to suit today's reader. The history of writing is not a warehouse for storing the rules of the past. It is a mirror that lets us judge today's sentences more accurately.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>The standards of good writing are not fixed laws but have been made within the media and readers of each era.</li>
<li>The age of speech made the order of persuasion and credibility important, and the ages of copying and print made preservation and structure important.</li>
<li>Newspapers, magazines, and schooling widened the standards of writing that is quickly understood and writing that can be evaluated.</li>
<li>Writing in the digital age stands on new conditions that require weighing search, connection, readability, and trust together.</li>
</ul>]]></description>
      <category>writing</category>
      <pubDate>Thu, 25 Jun 2026 02:07:32 GMT</pubDate>
    </item>
    <item>
      <title>How Media Change the Way We Write</title>
      <link>https://opkle.app/abstract/blog/writing/media-changes-writing?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/writing/media-changes-writing?lang=en</guid>
      <description><![CDATA[<p>Writing changes depending on where it is written. Words carved in stone, a hand-copied book, printed paper, a newspaper page, a blog screen, and a sentence in a phone notification are not read in the same way. Media look like vessels that hold writing, but in fact they change its length and speed, its sentences and structure, and its relationship with the reader. Even when writing the same words, a writer has to think about where they will be read.</p>
<p>The standards of good writing have also changed along with media. For writing meant to be preserved for a long time, stability and accuracy mattered. A newspaper needed quick comprehension and the power of a headline. On the web, search and links, scrolling and readability on screen became important. Ebooks once again ask for both long-breathed reading and the flexibility of the digital environment.</p>
<p>In this article, we look at how media have changed writing. The point is not to be dragged around by media, but to understand the way of reading each medium asks for and to set up the standards of writing anew. Good writing has to know not only its own content but also the place where it will sit.</p>
<p>1. We look at why the medium in which writing sits changes its sentences and structure.</p>
<p>2. We find out what standards of writing print, newspapers, the web, mobile, and ebooks each nurtured.</p>
<p>3. We think about the difference between fitting a medium and being tossed around by it.</p>
<p>4. We sum up why a sense of the medium matters in writing today.</p>
<h2>A Medium Sets the Length and Speed of Writing</h2>
<p>When the medium changes, so does the time in which the reader meets the writing. A book is a medium people read while staying with it for a relatively long time. Readers follow the sentences, flip back and forth, and prepare to take in a long breath. Much newspaper and web writing, by contrast, is read faster. Readers decide from the headline and first paragraph whether to read on, and move around looking for the information they need.</p>
<p>This difference changes sentences. Writing that is read for a long time can build background and scene slowly, while writing that is read quickly has to show the central information first. On a mobile screen, even a slightly long paragraph can feel like a burden. Conversely, in a book or a long essay, paragraphs chopped too fine can get in the way of depth of thought. The same paragraph can look like white space on paper and like a wall on a phone.</p>
<p>A writer must understand the speed of the medium. This doesn't mean writing everything short or everything long. It means thinking about the situation in which the reader will meet the piece. A medium does not decide the essence of writing, but it greatly changes the way writing arrives at the reader.</p>
<p><strong>Reading Conditions That Media Change</strong></p>
<ul>
<li>The time the reader can stay with the writing changes.</li>
<li>The length of paragraphs and the need for subheadings change.</li>
<li>The amount of information the introduction must show changes.</li>
<li>Actions such as rereading, searching, saving, and sharing change.</li>
</ul>
<h2>Print Created the Order of Long Writing</h2>
<p>The printed book made it possible to hold long writing stably. Chapters and sections, tables of contents and page numbers, footnotes and indexes helped readers find their way within long texts. Writing became not words that pass by once but a structure you can return to and check. This structure had a great influence on writing, too.</p>
<p>Writing for a book allows a long breath. It can spread one subject across several chapters, take back later the question it raised earlier, and let the reader build thought slowly. So in print media, overall structure, long-range logic, and the stability of sentences became important.</p>
<p>But the stability of print can sometimes become heaviness. Once printed, writing is hard to fix, and it doesn't converse with the reader at once. So print writing raised the importance of review, editing, and proofreading before publication. The longer a medium lasts, the more carefully a writer had to choose sentences.</p>
<h2>Newspapers and Magazines Strengthened the First Paragraph</h2>
<p>Newspapers and magazines had to catch the reader's eye fast. They had to deliver important information in limited space, and readers moved among many articles. So the headline, the first paragraph, and the arrangement of key information became important. Writing could not afford a slow start.</p>
<p>Writing in this medium developed the arts of summary and emphasis. Telling the core of an event first and then adding background and context influenced many kinds of explanatory writing. It is a structure that lets readers get the important content first even if they are short of time.</p>
<p>But this approach does not suit every piece. Essays, criticism, and literary writing sometimes need to be entered slowly. Newspaper-style clarity is powerful, but turning every thought into a quick conclusion can reduce the depth of the writing. The standards a medium created should be chosen when needed, not made the law for all writing.</p>
<h2>The Web Made Writing a Connected Document</h2>
<p>On the web, writing is not alone. It is found in search results, linked to other documents, and set among images and videos, comments, and shares. Readers sometimes read from beginning to end, but also read only the parts they need, or read while comparing with other pieces. The web made writing not an isolated document but a connected one.</p>
<p>In this environment, subheadings, links, sources, summaries, and the readability of paragraphs became important. Writing must be searchable, readers must be able to find the information they want, and there must also be a way to move on to other materials. But many links do not make good writing. Connection should exist to help the reader understand.</p>
<p>The difficulty of web writing lies between discoverability and depth. In trying to write what search picks up well, it is easy to cling only to titles and keywords, and in pursuing depth, you can lose the entrance by which readers come in. Good web writing must be easy for readers to discover and, once they are inside, provide trust and a flow of thought. A click is only the beginning of the writing; the trust that remains after reading is its actual result.</p>
<p><strong>Conditions of Web Writing</strong></p>
<ul>
<li>The title and first paragraph must consider search and the reader's expectations together.</li>
<li>Subheadings give a path to readers who skim.</li>
<li>Links and sources support the writing's credibility and reach.</li>
<li>Writing should be easy to discover and still leave something behind once it is read.</li>
</ul>
<h2>Mobile Changed the Sense of the Paragraph</h2>
<p>The phone screen greatly changed the sense of writing. A paragraph that looked just right on paper can feel long and stifling on a small screen. Readers read on the move, and meet writing between notifications and other apps. Screen width and reading situation change the length and rhythm of paragraphs.</p>
<p>Mobile writing often calls for short paragraphs, clear subheadings, and quick transitions. But this does not mean every thought has to be made short. Long thoughts can be read on mobile, too. They just need paragraphs where the reader can breathe, a structure the reader can come back to, and an arrangement that does not get the reader lost on the screen.</p>
<p>Writing in the mobile age is not a matter of saying only that readers' concentration has dropped. It is closer to saying that the places and times in which readers meet writing have multiplied. Good writing should look for a form that can still hand over depth within these conditions, rather than complain about them.</p>
<h2>Ebooks Ask for Both Long Writing and Digital Flexibility</h2>
<p>The ebook is an interesting medium. It is read with the long breath of a book, but its appearance changes with the screen, the type size, and the reader's settings. You could call it a medium between the stability of the paper book and the flexibility of the web. So writing for an ebook is not simply moving a manuscript into a file.</p>
<p>With ebooks, you have to think about the table of contents and chapter structure, the length of paragraphs, the placement of images and footnotes, even the reader changing the type size. Because the text reflows to fit the screen, the structure of the writing matters more than the fixed layout of a page. A heading must be clearly a heading, a quotation a quotation, and body text body text. A well-made ebook manuscript does not lose the order of its writing when the screen changes.</p>
<p>This environment asks a new sense of writers. They must write at length yet not fall apart on a variety of screens, and respect the reader's reading settings while keeping the book's atmosphere. The ebook is a good example of writing living anew to fit its medium.</p>
<h2>Writing That Understands Its Medium Travels Farther</h2>
<p>To fit a medium does not mean changing sentences to follow fashion. It means understanding the reading conditions of the place where the writing will sit. Whether it will appear in a book, arrive through search, serve as class material, a newsletter, or an ebook, the same subject should take a different structure and different sentences.</p>
<p>But we must not be tossed around by media. If you exaggerate a title for clicks, oversimplify thought to fit a short screen, or make sentences awkward for the sake of search terms, the writing will not last. A sense of the medium is not giving up the standards of writing. It is adjusting so that those standards reach the reader well.</p>
<p>Good writing knows its medium. It thinks about where it will be found, on what screens it will be read, and how readers can come back. And still it does not let go of the purpose, truthfulness, structure, and sentence-level responsibility the writing has to keep. This is exactly why good writing is needed even as media change.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>A medium changes the length, speed, paragraphs, structure, and relationship with the reader of writing.</li>
<li>Print nurtured the order of long writing, and newspapers and magazines nurtured quick comprehension and the power of the first paragraph.</li>
<li>The web and mobile brought the conditions of search, connection, screen readability, and skimming into writing.</li>
<li>Good writing understands the conditions of its medium without losing its purpose, truthfulness, and responsibility to the reader.</li>
</ul>]]></description>
      <category>writing</category>
      <pubDate>Thu, 25 Jun 2026 02:07:32 GMT</pubDate>
    </item>
    <item>
      <title>When the Reader Took Center Stage</title>
      <link>https://opkle.app/abstract/blog/writing/readers-and-writing?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/writing/readers-and-writing?lang=en</guid>
      <description><![CDATA[<p>Writing exists to be read by someone. Yet in the history of writing, the reader has not always stood at the center. Writing in some eras was set before gods and kings, law and tradition. Some was read only within scholarly communities, and some was closer to an act of revealing the writer's inner life. Even the phrase “thinking of the reader” has meant different things in different times.</p>
<p>Today, when we write, we naturally ask about the reader. Who will read this? What do they already know? Where will they get stuck? What should they take away? Modern writing such as blog posts, newsletters, online classes, product guides, and ebook descriptions easily loses its force without a sense of distance from the reader. In an age when there is so much writing, what the writer wants to say is not enough. We also have to see why the reader has come to this piece in the first place.</p>
<p>But putting the reader at the center does not mean lowering everything to suit the reader's mood, or dressing up the writing to win a click. Good writing respects the reader without losing the writer's own standards. In this article, we look at how the reader became an important standard in writing, and think about how to treat the reader in writing today.</p>
<p>1. We look at why the reader's place in writing has changed from era to era.</p>
<p>2. We find out how print and mass media nurtured reader-centered writing.</p>
<p>3. We think about the difference between considering the reader and being dragged along by the reader.</p>
<p>4. We sum up the relationship between reader and writer in writing today.</p>
<h2>Older Writing Sometimes Looked to Authority Before the Reader</h2>
<p>By today's sense, it feels as if all writing should think of the reader first. But much old writing was not aimed at a broad readership. Religious texts, laws, scholarly records, and writing presented to a king were produced within a particular authority and form. What mattered more to these works than who could understand them easily was how precisely they kept a fixed order and meaning.</p>
<p>That does not mean there were no readers. But the reader was not imagined as the diverse, anonymous public we imagine now. The people who could read were themselves limited, and writing circulated slowly. Writers imagined a particular community before a broad readership: teacher and pupil, official and king, a community of faith.</p>
<p>In such an environment, the standard of good writing differed from today's. Precision of form, connection to tradition, and an authoritative style could matter more than easy communication. Sentences that feel stiff and distant to us now were, in their time, a way of keeping the place and relationship in which the writing had to stand.</p>
<h2>Print Created the Anonymous Reader</h2>
<p>As more books were printed and distributed, writers had to imagine readers they could never meet in person. These readers could not hear the writer's explanation beside them, and could not ask about what they did not understand. The writing had to be read on its own, even where the writer was not present. This brought about a major change in writing.</p>
<p>Writing for an anonymous reader needs a clearer structure. Titles and tables of contents, the order of chapters, and the connections between paragraphs have to guide the reader. Because writers cannot be sure what readers know, they prepare the necessary background, explain difficult concepts, and try not to skip steps of the logic.</p>
<p>The reader of a printed book was not simply a consumer. He or she was someone who sat alone with the writing and judged it. Good writing has to trust that reader. It must not explain so much that it blocks the reader's thinking, nor so little that it leaves the reader stranded. Reader-centered writing grew out of finding this balance. Writing that trusts the reader does not try to think everything for them. It provides just enough order for the reader to continue the thinking on their own.</p>
<p><strong>How the Anonymous Reader Changed Writing</strong></p>
<ul>
<li>Writing has to be understood even where the writer is absent.</li>
<li>Titles, tables of contents, and paragraph structure become the reader's guides.</li>
<li>Background explanation and the steps of logic grow more important.</li>
<li>The reader becomes not a passive recipient but someone who judges the writing.</li>
</ul>
<h2>Mass Media Made the Reader's Time More Important</h2>
<p>Newspapers and magazines, radio and television, and then the web made the reader's time a fiercer standard. Readers choose among countless pieces of writing and content. Writers have to show quickly why the reader should read this piece now. That is why titles, first paragraphs, subheadings, and paragraph length have become more important.</p>
<p>This change made writing kinder. Articles explaining complex social problems to the public, columns that unpack specialized information, and guides on everyday problems increased. The question “Does it get read?” entered strongly into the standards of writing. The thought was that however important the content, writing struggles to fulfill its role if the reader cannot reach it. Good writing had to keep its depth and still build an entrance.</p>
<p>But as the reader's time grew more important, so did the temptation. A more provocative headline, a faster conclusion, a simpler structure of conflict can catch the reader's eye. Reader-centered writing means respecting the reader's time, not manipulating the reader's reactions. Good writing holds the reader without deceiving them.</p>
<h2>Thinking of the Reader Does Not Mean Using Only Easy Words</h2>
<p>The advice to think of the reader is often understood as “write simply.” Easy sentences certainly matter. Writing that uses hard words needlessly, or throws out technical terms without explanation, pushes readers away. But writing that respects the reader need not always choose only the easiest words.</p>
<p>Some readers want deep explanation. Some want to know the real difficulty of making a judgment more than a simple definition. Some already know the beginner's material and are now curious about exceptions, limits, and objections. Thinking of the reader is not looking down on their level. It is seeing accurately what question the reader is facing right now.</p>
<p>So good writing does not only make the reader comfortable. At times it hands the reader a new concept, makes them read slowly, and has them take a second look at a belief they held too easily. But that difficulty should serve to widen the reader's understanding, not to show off the writer. Writing that respects the reader builds a road even when the going is hard.</p>
<p><strong>Questions to Ask When Thinking of the Reader</strong></p>
<ul>
<li>What does the reader already know before reading this?</li>
<li>Where does the reader actually get stuck: in the words, in the structure, or in the judgment?</li>
<li>Which parts should be written simply, and which should be treated in depth?</li>
<li>Is this piece spending the reader's time honestly?</li>
</ul>
<h2>Today's Reader Compares While Reading</h2>
<p>A reader in the digital environment does not read just one piece. They compare search results, open several tabs, and look at comments, reviews, and other people's summaries together. The writer's authority alone can hardly hold a reader for long anymore. Readers quickly judge whether the writing is accurate, whether it helps, and whether it exaggerates.</p>
<p>In this environment, reader-centered writing has to become more delicate. It should let the reader find the information they need quickly without giving up the depth of the piece. It should show its sources and standards, keep the promise between title and body, and make clear how far the writing can speak and where the reader needs to check further.</p>
<p>Today's readers have not become pickier. They simply have more choices. Good writing should respect these readers rather than fear them. More important than keeping readers from leaving is giving them a reason to trust this writing and come back. A reader can leave at any time, but will stop again before writing they can trust.</p>
<h2>Good Writing Adjusts the Distance Between Reader and Writer</h2>
<p>If a writer keeps the reader too far away, the writing feels cold and closed. If they are too conscious of the reader, the writing wavers. It tries to satisfy every reader's reaction in advance and may lose what it actually has to say. Good writing adjusts the distance between the two.</p>
<p>Thinking of the reader does not mean abandoning the writer's standards. In fact, the clearer the standards, the better the writer can meet the reader. This is because they can choose whom the piece speaks to, what it promises, and which parts to unpack simply and which to leave deep.</p>
<p>In the end, the reader is not an evaluator outside the writing but a presence that has entered it. The order of paragraphs, the choice of examples, the speed of explanation, and the distance of the conclusion all carry an imagination of the reader. Good writing is aware of the reader but is not dragged along by the reader. Writing that respects the reader while keeping the center of its own words is the writing that lasts.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>The reader's place in writing has changed with the era and the medium.</li>
<li>Print and mass media made writers imagine more deeply the anonymous readers they would never meet.</li>
<li>Thinking of the reader does not mean always writing easily. It means honestly building the road of understanding the reader must travel.</li>
<li>Good writing today must respect the reader's time without losing the writer's standards and center.</li>
</ul>]]></description>
      <category>writing</category>
      <pubDate>Thu, 25 Jun 2026 02:07:32 GMT</pubDate>
    </item>
    <item>
      <title>How Sentences and Rhythm Reshape Thought</title>
      <link>https://opkle.app/abstract/blog/writing/sentence-rhythm-and-style?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/writing/sentence-rhythm-and-style?lang=en</guid>
      <description><![CDATA[<p>The same idea reads completely differently depending on the sentences it is written in. A short sentence cuts firmly, and a long sentence lets the reader follow the flow of thought. Easy words call the reader closer, and unfamiliar words make them pause. Sentences and rhythm are not the surface of writing. They change the speed and depth at which the reader takes in an idea. So the sentence is not a final decoration but the actual passage through which thought reaches the reader.</p>
<p>A good sentence is not simply a beautiful one. It is one that fits the purpose of the writing. It is clear when it has to explain, firm when it has to persuade, and leaves room when it has to make us feel. Style shows the writer's individuality, but if that individuality blocks the reader's understanding, the writing gets locked inside itself.</p>
<p>In this article, we look at what role sentences and rhythm play in writing. Writing sentences well is not about knowing many fine expressions. It is about handling the speed and distance at which a thought arrives at the reader, its breath and its white space.</p>
<p>1. We look at how sentences change the meaning of writing and the speed of reading.</p>
<p>2. We find out what strengths short sentences and long sentences each have.</p>
<p>3. We think about how style and individuality should balance with the reader's understanding.</p>
<p>4. We sum up the attitude toward reading and revision that polishing sentences requires.</p>
<h2>A Sentence Is How a Thought Arrives at the Reader</h2>
<p>A sentence looks like a vessel that holds a thought, but in fact it changes the thought's shape. If the same content is unfolded at length, the reader follows the process. If it is cut short, the reader feels the force of the conclusion first. A sentence heavy with explanation widens the background, and a sentence with much omitted gives room to the reader's imagination.</p>
<p>So choosing a sentence is not only choosing an expression. It is deciding at what speed the reader should meet this thought, where they should stop, and where to be certain and where to ask a question. A sentence carries the meaning of the writing and, at the same time, sets the speed of that meaning.</p>
<p>A good writer does not write sentences only to personal taste. They think about which sentences this piece's reader needs. When explaining an unfamiliar concept, they do not drag the sentence out too long, and when showing the grain of a feeling, they sometimes allow a long breath. A sentence is the writer's voice, but it is read within the reader's breathing.</p>
<p><strong>What Sentences Decide</strong></p>
<ul>
<li>They decide whether the reader receives the thought quickly or follows it slowly.</li>
<li>They create the balance between explanation and white space, assertion and question.</li>
<li>They adjust the sense of distance between writer and reader.</li>
<li>They create the speed and tension that suit the purpose of the writing.</li>
</ul>
<h2>Short Sentences Give Force but Do Not Solve Everything</h2>
<p>Short sentences are strong. They make the point clear, quicken the rhythm, and hold the reader's attention. They help greatly when the information is complex or the conclusion must be shown sharply. One short sentence set after a long explanation can anchor the center of the whole piece. In that brief pause, the reader notices what the writer is truly holding on to.</p>
<p>But if every sentence is short, the writing can turn stiff. If it keeps breaking off before the thought has fully unfolded, the reader finds it hard to go deep. When sentences stop too often, the writing can seem hurried rather than powerful. A short sentence is a tool for emphasis, not the answer for every piece.</p>
<p>What matters is knowing where to place a short sentence. The words the reader must remember, the words that gather up a long explanation, the words that leave the weight of a feeling can be kept short. When background and context must be explained, somewhat longer sentences are needed. The length of a sentence should vary not by taste but by role.</p>
<h2>Long Sentences Create Depth but Can Blur</h2>
<p>Long sentences are good for showing the grain of thought. When a single event holds several reasons and feelings, a long sentence can follow that complexity. In essays, criticism, and reflective writing, a long sentence sometimes leads the reader slowly along and builds layers of thought.</p>
<p>But long sentences blur easily. Subject and predicate drift apart, modifiers pile up, and the center of what the sentence wants to say can waver. The writer feels they have explained everything within one sentence, but the reader may get lost halfway. A long sentence demands more responsibility.</p>
<p>When writing a long sentence, don't lose its center. Check what the sentence finally says, whether the explanation in the middle is truly needed, and whether it has commas and clauses where the reader can breathe. A good long sentence is not difficult because it is long. It is one that carries a thought needing a long breath all the way to its end.</p>
<p><strong>Questions for Checking a Long Sentence</strong></p>
<ul>
<li>Are the central subject and predicate of this sentence clear?</li>
<li>Is the explanation in the middle helping the point or blurring it?</li>
<li>Would it be clearer split in two?</li>
<li>Is the long breath truly needed for the mood and thought of the piece?</li>
</ul>
<h2>Rhythm Comes from Repetition and Change</h2>
<p>The rhythm of writing is not made by sentence length alone. When sentences of the same structure repeat and then change at some point, the reader feels the change. When similar words return at regular intervals, the subject grows distinct, and when a different word suddenly enters, a new turn arises. Rhythm arises from the relationship between repetition and change.</p>
<p>Repetition can make writing dull, but used well it holds the center of the piece. You can bring up the same question again in a different scene, or return a key word in each paragraph with a slightly different meaning. The trouble comes when the repetition is not conscious. If the same conclusion is stated several times, or every paragraph begins with the same connecting word, the writing goes slack.</p>
<p>Good rhythm shows itself when read aloud. You can find sentences that leave you out of breath, sentences that end too much alike, and sentences that lose force where they should stress. Writing is read with the eyes, but sentences always keep a trace of sound. Polishing rhythm means watching how the writing passes through the reader's body. A good sentence should not trip the breath before it is understood by the mind.</p>
<h2>Style Is Both Individuality and a Promise</h2>
<p>Style shows the writer's individuality. Some people write in a neat, calm manner, some write as if speaking, and some use many metaphors and images. Style reveals the distance and speed at which a writer looks at the world. So style is not mere ornament.</p>
<p>But style is also a promise to the reader. If a piece begins with calm explanation, the reader expects that attitude. If it suddenly switches to an overblown style in the middle, the reader may doubt the center of the piece. Conversely, if the subject and feeling change and the style does not change at all, the writing can turn dull.</p>
<p>Keeping to a style does not mean always writing the same way. It means adjusting your voice to the purpose of the writing, the reader, and the weight of the subject. A good style reveals the writer, but does not make only the writer visible. It puts individuality forward only as much as is needed so the reader can reach the content.</p>
<h2>Sentences Get Better When You Reread Them at the End</h2>
<p>The sentences of a first draft are the place where thought passed through. So they need not be perfect from the start. In fact, in a first draft, being too careful with sentences can keep the thinking from moving forward. It is better to write first and look again at each sentence's role and rhythm later.</p>
<p>When revising, don't look at sentences one by one in isolation. Look at them within the flow of the whole piece. Check whether the sentence repeats what an earlier paragraph already said, whether it builds the momentum to move to the next paragraph, and whether it puts its own charm ahead of the center of the piece. Even a sentence you like may have to go for the sake of the whole.</p>
<p>A good sentence is often made not in the moment of writing but in the time of rereading. Leave it for a day, read it aloud, or follow it from the first paragraph as the reader would, and the problems in the sentences show. Those who write sentences well are not the ones who write fine sentences from the start, but the ones who keep checking, to the end, what each sentence has to do inside the piece. Sentences improve not so much in a flash of talent as at the fingertips of someone rereading again and again.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>A sentence does not only hold a thought. It changes the speed and manner in which the reader takes the thought in.</li>
<li>Short and long sentences each have a different strength, and should be placed to suit the purpose of the writing.</li>
<li>Rhythm is made from sentence length, repetition, change, and the breath felt when reading aloud.</li>
<li>Good style reveals the writer's individuality without blocking the reader's way to the content.</li>
</ul>]]></description>
      <category>writing</category>
      <pubDate>Thu, 25 Jun 2026 02:07:32 GMT</pubDate>
    </item>
    <item>
      <title>How Structure and Logic Take Shape</title>
      <link>https://opkle.app/abstract/blog/writing/structure-and-logic-of-writing?lang=en</link>
      <guid isPermaLink="true">https://opkle.app/abstract/blog/writing/structure-and-logic-of-writing?lang=en</guid>
      <description><![CDATA[<p>The structure of a piece of writing lies deeper than its table of contents. Adding a few subheadings does not give writing a structure. Good structure is the order in which questions and evidence, examples and conclusions are placed so that the reader can follow the thinking. It is less an arrangement that lays out everything the writer knows than a road built so the reader can arrive at understanding. A well-designed piece does not make the reader endure the next paragraph. It makes them naturally curious about it.</p>
<p>Logic, too, is not merely a cold set of rules. Logic is the connection that lets the reader feel, “So that is why the next thing comes.” Writing earns trust when the necessary bridges stand between sentence and sentence, paragraph and paragraph, example and claim. When the connections are missing, even fine sentences cannot save the persuasiveness of the piece.</p>
<p>In this article, we look at how the structure and logic of good writing are built. More important than knowing how to draw up an outline is knowing why things must come in that order. Structure and logic are tools for organizing the writer's thinking, and they are also a way of approaching the reader honestly.</p>
<p>1. We look at how the structure of writing differs from a simple table of contents.</p>
<p>2. We find out what promises the introduction, the development, and the conclusion make to one another.</p>
<p>3. We think about the flow of logic as an invisible bridge between sentences.</p>
<p>4. We sum up why good structure makes writing deeper and easier to read.</p>
<h2>Structure Is the Reader's Route, Not the Writer's Knowledge</h2>
<p>Writers know their subject from many angles. So when they start writing, related thoughts rush in all at once. They want to give a definition, add the history, show examples, and take up objections. But the reader cannot receive all those thoughts at the same time. Writing is read one sentence and one paragraph at a time.</p>
<p>Structure is the work of putting all this material in an order the reader can follow. The start has to be where the reader currently stands. From what they already know, what they are curious about, and what they misunderstand, the piece moves them step by step to the next stage. Throwing out the thing the writer considers most important first is not always good structure.</p>
<p>Good structure thinks about how the reader's questions change. A reader who begins by asking “What is this?” can be led to ask “Why does it matter?” in the middle, and “Then how should I judge it?” at the end. The structure of a piece is not an arrangement of information but the order in which the reader's thinking changes.</p>
<p><strong>Questions to Ask When Building Structure</strong></p>
<ul>
<li>What state is the reader in before the first paragraph?</li>
<li>What background is needed first to understand the main claim?</li>
<li>Do examples and explanations, claims and evidence follow one another naturally?</li>
<li>How is the reader who arrives at the last paragraph different from the reader at the start?</li>
</ul>
<h2>The Introduction Is the First Promise to the Reader</h2>
<p>The introduction is where the door of the piece opens. But it is not just a place to catch the reader with a clever sentence. It tells the reader what problem the piece will take up, why it is worth reading, and within what range it will speak. Reading the introduction, the reader decides whether this piece deserves their time.</p>
<p>A good introduction does not promise too much. If it puts forward a big claim the piece cannot carry, the body quickly turns thin. If, on the other hand, the introduction is too general, the reader cannot tell why they should keep reading. The introduction should be the point where the reader's real problem meets the central question of the piece.</p>
<p>After writing the introduction, check it against the conclusion. See whether the question raised at the start returns at the end in a deeper form, and whether the body honestly met the expectations the introduction created. In good writing, the beginning and the end are not strangers. A piece closes when the promise of the introduction is handled responsibly in the conclusion. And if the real question of the piece only becomes visible after you have written the conclusion, going back to revise the introduction is good revision too.</p>
<h2>A Paragraph Is a Unit of Thought</h2>
<p>A paragraph is not a device for breaking lines so the page looks nice. A paragraph is where one thought stays. Within a paragraph there should be a central sentence and the explanation, examples, and evidence that support it. When several thoughts are mixed into one paragraph, the reader cannot tell where to focus.</p>
<p>A good paragraph has a role between the paragraph before and the one after. Some paragraphs raise a problem, some explain background, some show an example, and some push up toward the conclusion. When each paragraph's role is clear, the writing does not lose its flow even as it grows long.</p>
<p>When revising paragraphs, it is better to check the role before the sentences. Is this paragraph truly necessary? Does it repeat what the previous paragraph said? Is it creating a reason to move on to the next? Once the role of a paragraph is clear, editing the sentences gets easier too, because you can see what to keep and what to lighten.</p>
<p><strong>Questions for Checking a Paragraph</strong></p>
<ul>
<li>Does this paragraph hold one central thought?</li>
<li>Does it play a different role from the previous paragraph?</li>
<li>If there is an example, can you see which claim it supports?</li>
<li>Is it creating a reason to move on to the next paragraph?</li>
</ul>
<h2>Logic Is the Connection That Makes the Reader Believe</h2>
<p>Logical writing is not the same as stiff writing. Logic is the connection that lets the reader follow the writer's thinking and be convinced. Writing is logical when you can see why a given piece of evidence comes after a claim, why an example can support a conclusion, and why an objection is addressed at this point.</p>
<p>Weak logic often tries to cover the problem with connecting words. But words like “therefore,” “but,” and “in the end” do not create a real connection just by being there. What matters is whether a bridge of thought stands between them. If the reader feels no reason to cross from one sentence to the next, the connecting word becomes decoration. Logic arises not from words but from relationships.</p>
<p>To refine the logic of a piece, try attaching evidence to each claim. Sort out whether a sentence is a fact, an interpretation, or an evaluation, and check whether the needed data or experience is there. Logic is not the skill of voicing the writer's certainty loudly. It is an attitude of cutting a road so the reader can judge together with you.</p>
<h2>Objections Do Not Weaken Writing</h2>
<p>When writing, there are times you want to avoid objections. Mentioning possibilities that differ from your claim feels as if it would make the piece wobble. But good writing does not ignore important objections. In fact, depth comes into a piece when it deals with them. Readers gain trust from seeing that the writer does not view the problem simply.</p>
<p>Dealing with objections does not mean introducing every opinion at length. It means honestly addressing the doubts that actually affect the claim, the questions the reader will naturally have, and the conditions that limit the claim's range. In some cases, a single sentence saying “There are exceptions here” can make the writing firmer.</p>
<p>An objection is not a decoration that blurs the conclusion. It sets the range within which the conclusion can stand. Good writing does not assert everything. It shows how far its claim holds. That restraint, in fact, creates persuasiveness.</p>
<h2>Good Structure Asks Less of Each Sentence</h2>
<p>Writing with weak structure puts a heavy burden on its sentences. It tries to persuade in a single sentence a thought it has not prepared earlier, to cover thin evidence with strong expressions, and to close an abrupt conclusion with fine words. Writing whose sentences are overworked tires the reader easily.</p>
<p>By contrast, in writing with a firm structure, sentences can stay plain. Because the reader has already followed the necessary background and evidence, the conclusion gains force without exaggeration. Good structure does not pack the strength of the piece into one sentence. It spreads it across the flow of the whole.</p>
<p>So when revising, look at the structure before polishing sentences. A sentence may feel awkward not because of expression but because of the order of thought. Good writing is not good only because its sentences are good. It is good because it is built so that each sentence works in its own place, only as much as needed. In a well-structured piece, even a quiet sentence carries enough strength.</p>
<p><strong>Key Takeaways</strong></p>
<ul>
<li>The structure of writing is not a table of contents but the order in which the reader's thinking moves.</li>
<li>The introduction creates the promise of the piece, and the conclusion must handle that promise responsibly.</li>
<li>A paragraph is a unit of thought, and each one must have a clear role within the whole.</li>
<li>When logic and structure are firm, sentences gain force without exaggeration.</li>
</ul>]]></description>
      <category>writing</category>
      <pubDate>Thu, 25 Jun 2026 02:07:32 GMT</pubDate>
    </item>
  </channel>
</rss>
