we account differently for the ascender already

This commit is contained in:
Konstantin Käfer
2014-08-05 15:08:26 +02:00
parent a790e080a5
commit af4ecc6260
2 changed files with 2 additions and 2 deletions

View File

@@ -219,8 +219,7 @@ void SymbolBucket::addFeature(const std::vector<Coordinate> &line, const Shaping
anchors = {Anchor{float(line[0].x), float(line[0].y), 0, minScale}};
}
// TODO: figure out correct ascender height.
const vec2<float> origin = {0, -17};
const vec2<float> origin = {0, 0};
for (Anchor &anchor : anchors) {

View File

@@ -54,6 +54,7 @@ const Shaping FontStack::getShaping(const std::u32string &string, const float &m
}
void alignVertically(Shaping &shaping, const uint32_t &lines, const float &lineHeight, const float &verticalAlign) {
// TODO: figure out correct ascender height.
const float dy = -(lineHeight * (lines - 1) + 24) * verticalAlign - 5;
for (PositionedGlyph &shape : shaping) {
shape.y += dy;