Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font.GlyphData Overhaul, Proper Kerning Pairs #344

Closed
ilexp opened this issue Jun 27, 2016 · 2 comments

Comments

1 participant
@ilexp
Copy link
Member

commented Jun 27, 2016

Summary

The Font Resource is a very old class with some bad design choices. GlyphData is lacking and kerning is done using a custom algorithm rather than using imported kerning pair information.

Analysis

  • As a requirement, complete issue #324 first.
  • Move GlyphData out of Font and call it FontGlyphData.
  • Move RenderMode out of Font and call it FontRenderMode.
  • Replace Width and Height int values with one Vector2 Size.
  • Replace OffsetX and OffsetY int values with one Vector2 Offset.
  • Introduce a float Advance value that will determine how far the cursor will advance after this glyph, rather than using some internal calculations. The MonoSpace property will then become purely FYI.
  • Remove KerningSamplesLeft and KerningSamplesRight entirely and replace the kerning algorithm with an optionally provided set of kerning-pair-to-added-advance mappings that is maintained at the Font level.
  • Update embedded default Fonts according to the above changes.

@ilexp ilexp added this to the v3.0 milestone Jun 27, 2016

@ilexp ilexp self-assigned this Jan 9, 2017

@ilexp

This comment has been minimized.

Copy link
Member Author

commented Jan 9, 2017

Progress

  • Completed issue #324
  • Moved GlyphData out of Font and renamed it to FontGlyphData.
  • Moved RenderMode out of Font and renamed it to FontRenderMode.
  • Replaced Width and Height int values with one Vector2 Size.
  • Replaced OffsetX and OffsetY int values with one Vector2 Offset.
  • Updated all sample and embedded content.

Immediate ToDo

  • Introduce a float Advance value that will determine how far the cursor will advance after this glyph, rather than using some internal calculations. The MonoSpace property will then become purely FYI.
  • Remove KerningSamplesLeft and KerningSamplesRight entirely and replace the kerning algorithm with an optionally provided set of kerning-pair-to-added-advance mappings that is maintained at the Font level.
  • Update all sample content Fonts.
  • Update embedded default Fonts.
@ilexp

This comment has been minimized.

Copy link
Member Author

commented Jan 10, 2017

Progress

  • Introduced an Advance field to FontGlyphData.
  • Removed KerningSamplesLeft and KerningSamplesRight fields from FontGlyphData.
  • Removed all traces of the custom kerning algorithm from Font class.
  • Introduced FontKerningPair and FontKerningLookup types and re-implemented kerning in Font as a pure character pair lookup.
  • Introduced FontData container class for handling raw bitmap font data outside Font resources. Similar in its role to PixelData.
  • Serialization of Font resources is a lot more efficient, since the largest chunks of data are now serialized as compressed byte array data blocks. Both XML- and binary-serialized fonts are now a lot smaller.
  • Updated embedded fonts.
  • Updated all sample content fonts.

Done. Closing this.

@ilexp ilexp closed this Jan 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.