<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kosal on Medium]]></title>
        <description><![CDATA[Stories by Kosal on Medium]]></description>
        <link>https://medium.com/@kosalsen?source=rss-2b99dbed5c8d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lBKmECUUHOgXPHqsikGpUw.png</url>
            <title>Stories by Kosal on Medium</title>
            <link>https://medium.com/@kosalsen?source=rss-2b99dbed5c8d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 13:02:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kosalsen/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I built a Chess Rendering Engine inside an OpenType Font]]></title>
            <link>https://medium.com/@kosalsen/how-i-built-a-chess-rendering-engine-inside-an-opentype-font-27e4a4d520e7?source=rss-2b99dbed5c8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/27e4a4d520e7</guid>
            <category><![CDATA[opentype]]></category>
            <category><![CDATA[fonts]]></category>
            <category><![CDATA[chess]]></category>
            <category><![CDATA[diagrams]]></category>
            <category><![CDATA[typography]]></category>
            <dc:creator><![CDATA[Kosal]]></dc:creator>
            <pubDate>Fri, 19 Jun 2026 12:25:25 GMT</pubDate>
            <atom:updated>2026-06-19T12:25:25.201Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*HWr-n0aL5PbBKbiEMlwkLg.png" /></figure><p>TLDR: <a href="https://philatype.github.io/fenwright/">Try the demo</a> or <a href="https://github.com/philatype/fenwright">Check the repo</a> :)</p><p>Chess players have long used a compact shorthand called Forsyth-Edwards Notation, or <strong>FEN</strong>, to record board positions without needing to illustrate the chessboard. Originally developed in 1883 by Scottish newspaper journalist David Forsyth, this system was designed to be recorded expeditiously on a scrap of paper the size of a postage stamp. While it was later extended for computers by Steven J. Edwards in the 1990s, the core syntax remains a single line of text that captures every piece and empty square on the board.</p><p>Today, translating this notation back into a visual board is an engineering task that typically happens outside the text itself. Most modern solutions rely on scripting to parse the data and programmatically generate a grid of SVG images or HTML elements. Popular web tools like <a href="https://fen2image.chessvision.ai/"><strong>Fen2Image by chessvision.ai</strong></a> and libraries such as <a href="https://github.com/anandjoshi91/chessboard-image"><strong>anandjoshi91/chessboard-image</strong></a> specialize in this conversion, turning raw data into static images. This computational overhead, requiring external libraries just to see the data, sparked a different kind of question: What if the font file itself possessed the internal logic to serve as the rendering engine?</p><p>OpenType technology gives type designers a host of tricks to employ when designing fonts for various writing systems. To understand how a font can “write” a chess diagram, first let’s talk about the ligature. In simple terms, a ligature is a feature where a font swaps a sequence of characters for a single, combined drawing. You see this most often when a font turns the letters “fi” into a joined, elegant shape. This is not a new trick; ligatures have been around since the early days of moveable type to save space and prevent metal letter blocks from bumping into one another. In a modern OpenType font, this is handled by the <a href="https://learn.microsoft.com/en-us/typography/opentype/spec/gpos">GSUB (Glyph Substitution) table</a>, which acts as a set of “if/then” rules. I wanted to push this concept to its limit: if a font can swap “fi” for a new shape, could it swap a whole string of chess notation for a chessboard?</p><p>The project began with a significant technical hurdle: the failure of the “single drawing” ideal. My original hope was to draw each of the twelve chess pieces once and use code to move them to the correct squares. However, the <a href="https://learn.microsoft.com/en-us/typography/opentype/spec/gpos">OpenType rules for horizontal text</a> are very strict. The vertical movement of the “virtual pen,” known as <em>yAdvance</em>, is explicitly only used for vertical layout and is ignored in standard horizontal text runs. Since a FEN string is read horizontally, the pen could never move down to a new row. This technical wall forced a creative pivot: instead of trying to move the pen down, I had to move the art down. I ended up creating 147 pre-baked variants of the pieces, physically drawing them at different vertical heights in the glyph space to simulate an 8x8 grid.</p><p>To manage these variants with accuracy, the font operates within a Cartesian coordinate system, utilizing a 1000-unit design grid as a high-resolution canvas for the entire board. One of the most important challenges was figuring out how to align these piece-tile combinations into a perfect 8x8 grid within a single line of text. Normally, a font automatically moves the “virtual pen” forward — a value called advance width — after every character is drawn. To keep the pieces from simply marching off the right side of the screen, I used the GPOS table to meticulously control these horizontal movements. By dividing the 1000-unit square into an 8x8 grid, I created 64 coordinate zones — each exactly 125 units wide and tall — that act as a master map to ensure every piece variant lands exactly in its intended square relative to the baseline. Since the squares are baked directly into the piece glyphs, the font isn’t layering a pawn onto a board; it is simply selecting a single character that already contains both the piece and the square it stands on.</p><p>Handling the transition between rows required another creative use of coordinates. In the notation’s syntax, ranks are separated by a slash (/). I programmed the slash to act like a manual “rewind” button by giving it a massive negative horizontal movement (xAdvance) of -1000 units. Every time the font sees a slash, the virtual pen snaps all the way back to the left edge of the board to start the next rank. Combined with the “baked-in” heights of the pieces, this resets the pen position and creates the perfect illusion of a 2D layout.</p><p>Finally, I had to solve the checkerboard pattern and the empty spaces. Since fonts cannot “count” squares, I used <em>Chained Contexts Positioning</em> to create a “domino chain” of logic. Each square determines its own background color by looking at the piece immediately to its left; if the previous square is a dark variant, the font automatically swaps the current piece for a light-square variant. For empty squares, which the notation represents with numbers 1 through 8, I turned the digits into invisible spacers. An “8” is not a number in this font; it is an invisible box 1000 units wide that pushes the pen across the board to keep the columns perfectly aligned.</p><p>The result of this exploration is <a href="https://github.com/philatype/fenwright"><strong>FENwright</strong></a>, a font that functions less like a typeface and more like a lightweight, cross-platform software tool. <a href="https://philatype.github.io/fenwright/">Here’s the demo</a>. It builds as you type! By embedding the rendering logic directly into the font’s OpenType tables, I’ve created a system where a single line of text can generate a complex 2D diagram without the need for external scripts or heavy rendering libraries. FENwright is an open-source project and is currently available on GitHub for anyone to experiment with or use in their own chess application. It serves as a reminder that the typographic tech we use every day are capable of far more than just displaying letters; they are declarative blueprints capable of driving sophisticated finite-state machines for whatever purpose you need.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27e4a4d520e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[All You Need is a Tension (Part 2)]]></title>
            <link>https://medium.com/@kosalsen/all-you-need-is-a-tension-part-2-c823ea4cc9bf?source=rss-2b99dbed5c8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c823ea4cc9bf</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[user-experience]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[humanizing-technology]]></category>
            <category><![CDATA[large-language-models]]></category>
            <dc:creator><![CDATA[Kosal]]></dc:creator>
            <pubDate>Fri, 27 Jun 2025 14:34:11 GMT</pubDate>
            <atom:updated>2025-06-27T14:34:11.915Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*ADyxgNKouUGB_pvhiz_ocQ.png" /></figure><h4>Musings on humanizing LLM-based conversations</h4><p><a href="https://medium.com/@kosalsen/all-you-need-is-a-tension-c1708598f301">Part 1, here</a></p><h3>2. Tension in Timing</h3><p>Let’s continue our exploration of different kinds of tensions missing in our design of human-to-LLM interactions. Next up, timing. We have to acknowledge the tension inherent in the timing of conversations. Chatbot conversations are discrete, turn-based transactions — once a person has transmitted their message, the bot immediately starts working on a response. This experience is acceptable in text-based interactions, but it falls apart in a voice-based chatbot. Here, bots respond whenever the person stops speaking for some given amount of microseconds. Silence acts as the end-of-transmission signal. Compare that to a human-to-human conversation, where silences, or pauses in speech, play a very nuanced role. We encounter it as we listen and gauge the flow. We use it as we’re between thoughts, or finding the right words. Silence is tension. It does not <em>direct </em>us to respond, but it <em>helps</em> us decide on when. Misread it, and you might be guilty of interrupting. Chatbots understand none of that; they lead with the compulsion to reply.</p><p>Unlike LLMs, humans are not rapid-fire response machines. As a conversation runs its course, the pace and fidelity of the ideas we communicate naturally change. Between humans, timing is the negative space that mediates the discussion as a whole. To bots, timing is only a byproduct of interactions. Take, for instance, a service agent having a phone call with a customer. The rep might have helpful responses based on timing cues alone. Perhaps they notice a customer is taking longer than usual to locate an account number, so they ask if the customer is logged in. Or, in an opposing scenario, a customer’s early confirmation may reveal they didn’t <em>really </em>power cycle their device the 1 minute it should normally take. As was the case with tone, data about timing in a voice conversation is all but lost when we reduce a conversation into an LLM-friendly transcription. It makes zero difference to continue a chatbot conversation two weeks later, versus two seconds later. It should make a difference.</p><p>To solve this, we need to work around the current request/response model. Instead of the synchronous approach, where a bot responds after silence, what if it relied on a roving context window? Imagine a bot that listen continuously, constantly assessing if and when to respond. It should even listen <em>while</em> it responds. This would create a system that understands and allows hesitation, rhetorical statements, misspeaking, and interruptions. Accounting for a mixture of both synchronous and asynchronous exchanges is how this technology can start to build a human-like, empathetic rapport that’s missing.</p><p>The challenge lies not in adding pauses or hesitations to create an artificial sense of realism, but in developing systems that can understand and use them to patch into a transient conversation. Future AI developments should focus on creating models capable of processing ongoing dialogue, recognizing incomplete thoughts, and determining appropriate moments for response or interjection. This approach would require a shift from the current turn-based interaction model to one that more closely mirrors the dynamic and overlapping nature of human conversation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c823ea4cc9bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[All You Need is a Tension]]></title>
            <link>https://medium.com/@kosalsen/all-you-need-is-a-tension-c1708598f301?source=rss-2b99dbed5c8d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1708598f301</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[user-experience]]></category>
            <category><![CDATA[humanizing-technology]]></category>
            <category><![CDATA[generative-ai-use-cases]]></category>
            <dc:creator><![CDATA[Kosal]]></dc:creator>
            <pubDate>Mon, 25 Nov 2024 17:20:11 GMT</pubDate>
            <atom:updated>2025-06-27T14:35:24.478Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mxAQmbfFCoqRPq5R3EESLA.png" /></figure><h4>Musings on humanizing LLM-based conversations</h4><p>Words alone does not a conversation make. From SmarterChild to today’s Large Language Model (LLM)-based apps, chatbots are designed to engage in a natural conversation. They understand our words, churn out a response, and can even wrap it under a realistic voice. But as logical as this sounds, we’re still far from conversations that truly feel naturally human. There’s a crucial component missing from the tech stack: tension. In this multi-part series, I’ll break down different types of real-life tensions, with thoughts on how to potentially augment the stack so we can raise the bar on a more natural experience.</p><p>First, an oversimplified, non-technical primer on how LLM-based chatbots work. In the beginning, an empty computer brain was forced to remember all the text on the internet. That’s how we instilled it with knowledge. Then, we told it to play a game of word association by observing patterns on how words connect. So, each time we input a word to it, it would output related words. That game is how we taught it language. It was so good, given a fragment, or song lyrics, it could finish our sentences <em>and </em>sandwiches. Finally, equipped with general knowledge and a knack for prediction, we asked it to predict, i.e. emulate, a conversation. The result: greetings are reciprocated, and questions are met with answers. So that’s all an LLM chatbot does — take your input words and generates the proper output words.</p><p>The tensions we’ll explore focus on what current technology misses when partaking in a conversation. These are gaps that can’t be filled simply by giving an LLM more knowledge. They can’t be solved by improving its mastery of language. This missing dynamic exists outside of words.</p><h3>1. Tension in Tone</h3><p>The first tension is straightforward – tension in tone of voice. How we say something is just as important as what we’re saying. Think of all the nuanced ways you can say “yes” to a colleague’s request: dismissively, eagerly, with microaggression, even. Their response, and the ensuing conversation, delicately hangs on the tension introduced by your tone. Although voice chatbots have made great strides speaking with tone, they don’t at all care about <em>your</em> tone. Chatbot architectures are built to respond to a textual representation of what you said; not your voice, but a transcript of it. They’re quite literally tone-deaf. Without an acknowledgement of tone and how it tempers the back-and-forth, chatbots fail at the crucial task of creating an empathic human connection.</p><p>Working from transcripts means being bound by the limitations of typography. When your voice gets transcribed, it’s stripped of any acoustic personality; tone is merely left as an exercise for a human reader. Sure, we have some typographic tools and choices at our disposal… but are they <em>really enough? </em><strong>NOT A CHANCE</strong>! Even more modern attempts to adopt tone signifiers, like /s for sarcasm, and the interrobang (‽) have missed the mark 😉. Considering the range of tone possible with our voices, it’s impractical to expect typography to be a sufficient stand-in. On top of that, tone-based formatting is virtually ignored by LLMs. Typographic strings of characters are only a skinsuit for the semantic word. Yet, they function as the base currency of today’s <a href="https://en.wikipedia.org/wiki/Attention_Is_All_You_Need">LLMs transformer architectures</a>. Characters and their larger counterparts (prefixes, words, phrases, etc.), are the building blocks that LLMs tokenize to represent discrete units of meaning.</p><p>So, how do we shed this skinsuit and get closer to the natural essence of language? As a thought experiment, what if we used speech itself? Imagine a language model built solely from audio data of people having conversations. That’s audio from a real dialogue of multiple humans, speaking with each other. Instead of strings of characters, we’d train it on phonemes, allophones, sighs, and everything in between. Would the patterns and relationships captured from these utterances yield a tone-rich <em>and</em> word-based prediction model? Certainly seems possible. Also, perhaps the model would have a better innate grasp of a duplex conversation. Given a neural network, enough audio data, and a healthy dose of unsupervised learning, an emergent understanding of language is a perfectly reasonable expectation for such an approach. After all, isn’t that how babies learn?</p><p><a href="https://medium.com/@kosalsen/all-you-need-is-a-tension-part-2-c823ea4cc9bf"><em>Continue to Part 2</em></a>…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1708598f301" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>