Repository navigation
Conversation
richard-uk1
approved these changes
Nov 7, 2026
tomcur
approved these changes
Nov 7, 2026
| All this gives us everything we need to implement text rendering as an instance of display objects. | ||
|
|
||
| The text object itself contains the string (1 byte per character), a pointer to the font, and foreground and background colors. | ||
| RAM is precious, and more so for the display list because it's double buffered. |
Member
There was a problem hiding this comment.
Line 58 also mentions needing to be careful about the display list memory footprint due to the two copies.
Contributor
Author
There was a problem hiding this comment.
I'm leaving it in, I feel it's important enough to be mentioned in slightly different contexts. But thanks.
| The packing also makes sure no glyph straddles a 32-pixel chunk boundary, so one row of font pixels can always be read with a single 32 bit load. | ||
| If a glyph has space on either side of the glyph, that's not stored in the packed bitmap; rather, the space is in the per-glyph metadata. | ||
|
|
||
| In the spirit of micro-optimization, the packing algorithm also detects overlaps, as there's no requirement that pixels be unique to a single glyph. |
| The JIT output is about a 10x expansion over the input string. | ||
| And, from the numbers above, it's clear that the cost of running the JIT is minimal. | ||
|
|
||
| The name "just in time" is apt; in the implementation in vic-2350, the JIT compiler runs under 100µs before scanout of the video line. |
Comment on lines
+235
to
+236
| Basically, each glyph has two bitvectors, one each for the left and right side. | ||
| To kern two glyphs, take the `and` of the right bitvector of the first glyph and the left bitvector of the second, then the popcount (number of `1` bits) of that, resulting in the number of pixels to kern. |
Member
There was a problem hiding this comment.
What do the bits stand for, and how are they chosen?
Contributor
Author
There was a problem hiding this comment.
I've added a section.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.