freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Some questions about the OT-SVG implementation


From: Moazin K
Subject: Some questions about the OT-SVG implementation
Date: Tue, 2 Nov 2021 04:03:44 +0500

Hi Werner,

I want to talk about two minor things about the OT-SVG implementation. 

1. `FT_LOAD_NO_SCALE`: For CFF/TTF outlines, this flag loads the outlines, but in font units, if you directly render it by `FT_Render_Glyph`, the render functions just assume that the points are in 26.6 point format, which isn't the case and thus you get a very small rendering (of size ~15 I think). I'm not sure what to do with this flag when it comes to OT-SVG glyphs. For OT-SVG glyphs, I don't really have any outline data, I just store a transformation matrix with scale information that takes care of the sizing. If we leave the matrix to identity, it'll render to whatever the viewBox is set to in the SVG document, which is sometimes 1000x1000 or 128x128, or it could be anything really. Another option is to set a transform such that if you directly render the glyph it'd be at the same scale at an equivalent TTF/CFF glyph which was loaded via FT_LOAD_NO_SCALE. I'm completely clueless about which one to go about. Any thoughts on this?

2. `FT_LOAD_MONOCHROME` and other LCD modes: So this flag `FT_LOAD_MONOCHROME` and other `FT_RENDER_MODE_XXX` flags are there and I don't think it makes sense to keep these for OT-SVG glyphs. The very reason why there is OT-SVG is that people want colored fonts. I'm not sure if the LCD modes make any sense? Maybe I can return errors from the rendering module if these modes are requested in `FT_Render_Glyph`?

Thank you,
Moazin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]