Demonstrandum / Acetone

Haskell 2D Graphics
GNU General Public License v3.0
0 stars 0 forks source link

Text rendering/shaping with FreeType+HarfBuzz to pixel buffers. #4

Open Demonstrandum opened 2 years ago

Demonstrandum commented 2 years ago

Text is not a rectangle with a texture (although it actually is), that would be misleading to conventional fill and stroke functions, which would behave like this is a rectangle, and not stroke/fill the actual text.

Text is handled separately, and is regarded as a primitive geometry.

Handle alignment, shaping, styling, sizing, fonts, hinting, option, all within a big record which can be translated to what harfbuzz understands. functions like text should be incredibly simple (in contrast) however.

text :: Font -> String -> Shape
Demonstrandum commented 1 year ago

See https://metalbyexample.com/text-3d/ https://freetype.org/freetype2/docs/reference/ft2-outline_processing.html on getting vertex data from glyphs also, incase text manipulation wants to be done on the vertex level.