-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
newpaint: actually spaces _are_ represented in output! use advance on…
…ly for bounds - works great in practice. still a minor test glitch -- off by 1. could investigate further later.
- Loading branch information
Showing
4 changed files
with
33 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# shaped | ||
|
||
This is the package that interfaces directly with go-text to turn rich text into _shaped_ text that is suitable for rendering. The lowest-level process is what harfbuzz does (https://harfbuzz.github.io/), shaping runes into combinations of glyphs. In more complex scripts, this can be a very complex process. In Latin languages like English, it is relatively straightforward. In any case, the result of shaping is a slice of `shaping.Output` representations, where each `Output` represents a `Run` of glyphs. Thus wrap the Output in a `Run` type, which adds more functions but uses the same underlying data. | ||
|
||
The `Shaper` takes the rich text input and produces these elemental Run outputs. Then, the `WrapLines` function turns these runs into a sequence of `Line`s that sequence the runs into a full line. | ||
|
||
One important feature of this shaping process is that _spaces_ are explicitly represented in the output. | ||
|
This file contains 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
This file contains 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