1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Font: Allow switching between legacy non-portable metrics, and new portable metrics

This commit is contained in:
reuk 2024-03-19 23:33:55 +00:00
parent 4f2c287f9b
commit c2fce879c5
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C
12 changed files with 291 additions and 464 deletions

View file

@ -81,7 +81,7 @@ void PositionedGlyph::createPath (Path& path) const
if (auto t = font.getTypefacePtr())
{
Path p;
t->getOutlineForGlyph (glyph, p);
t->getOutlineForGlyph (font.getMetricsKind(), glyph, p);
path.addPath (p, AffineTransform::scale (font.getHeight() * font.getHorizontalScale(), font.getHeight())
.translated (x, y));
@ -96,7 +96,7 @@ bool PositionedGlyph::hitTest (float px, float py) const
if (auto t = font.getTypefacePtr())
{
Path p;
t->getOutlineForGlyph (glyph, p);
t->getOutlineForGlyph (font.getMetricsKind(), glyph, p);
AffineTransform::translation (-x, -y)
.scaled (1.0f / (font.getHeight() * font.getHorizontalScale()), 1.0f / font.getHeight())