Commit Graph

3 Commits (005ff7e31b2eb0c292055948e8bd359457640937)

Author SHA1 Message Date
EvilSpirit e74ccb3010 Perform grid fitting on the builtin vector font.
Grid fitting is performed only on glyph boundaries, since glyphs
include curves converted to pwl, which would be mangled by per-point
grid fitting.

Grid fitting is only performed when the plane in which text is
laid out is parallel to the viewing plane.

Grid fitting is only performed when rendering for display; there
are no devices with dpi low enough for grid fitting to become
profitable, and in any case we cannot predict what the dpi would
be anyway.
2016-04-16 04:19:14 +00:00
EvilSpirit bd6c4c0cbd Use 16-bit integers to store builtin vector font data.
This significantly increases font legibility, since curves are
represented more precisely. The file size is increased by mere ~1M
(from 7M).
2016-04-16 03:10:56 +00:00
EvilSpirit 57fb3bf3dc Replace internal vector font with LibreCAD's GPLv2+ vector font.
This font is less complete than our bitmap font, Unifont: Unifont
has essentially complete Unicode coverage and LibreCAD's font only
has Latin, Cyrillic and Japanese, but it can be extended rather
easily, so this should be fine for now.

These embedded fonts fatten glhelper.o quite a bit:
bitmapfont.table.h is about 8M in gzip-compressed bitmaps and
vectorfont.table.h is about 2M in raw vector data.
In spite of that it takes just around five seconds to build
glhelper.c on my laptop, so it should be fine.

The final executable grows from about 2M to about 8M, but this
is a small price to pay for fairly extensive i18n support.

The new font has somewhat different metrics, so the rendering
code has been fudged to make it look good.
2016-02-14 14:09:36 +00:00