[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] How to compute the baseline for for a font face?
From: |
R0b0t1 |
Subject: |
Re: [ft] How to compute the baseline for for a font face? |
Date: |
Tue, 18 Apr 2017 17:33:13 -0500 |
Hello, I apologize for the double post, but I made some progress. I
think I am now in search of the maximum y bearing for a glyph within a
face. If that doesn't exist and I need to arrive at that value via
some other method please let me know.
```C
float x = 0.0f + 1.0f / window_width * (current.bearing_x), // bearing x.
y = (1.0f / window_height * (current.height -
current.bearing_y)) - // should be height - max bearing y.
1.0f / window_height * (current.height -
current.bearing_y); // height - bearing y.
```
That will properly draw glyphs such as "g" or "/" above the horizontal
axis as I intend, but as it uses the per-glyph metrics each individual
glyph will be barely above the axis, glyphs such as "a" will have no
space under them.
Cheers,
R0b0t1