Browse Source

Tiny tweak to the typeface hinting algorithm.

tags/2021-05-28
jules 11 years ago
parent
commit
01dc36d29d
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      modules/juce_graphics/fonts/juce_Typeface.cpp

+ 2
- 2
modules/juce_graphics/fonts/juce_Typeface.cpp View File

@@ -186,8 +186,8 @@ private:
{ {
const float newT = std::floor (fontSize * t + 0.5f) / fontSize; const float newT = std::floor (fontSize * t + 0.5f) / fontSize;
const float newB = std::floor (fontSize * b + 0.5f) / fontSize; const float newB = std::floor (fontSize * b + 0.5f) / fontSize;
const float newM = std::floor (fontSize * m + 0.5f) / fontSize;
const float newM = std::floor (fontSize * m + 0.3f) / fontSize; // this is slightly biased so that lower-case letters
// are more likely to become taller than shorter.
upperScale = jlimit (0.9f, 1.1f, (newM - newT) / (m - t)); upperScale = jlimit (0.9f, 1.1f, (newM - newT) / (m - t));
lowerScale = jlimit (0.9f, 1.1f, (newB - newM) / (b - m)); lowerScale = jlimit (0.9f, 1.1f, (newB - newM) / (b - m));


Loading…
Cancel
Save