Fix horizontal alignment with font, add new fonts
This commit is contained in:
parent
f73cb3ce03
commit
809744c300
BIN
assets/opensb/font/iosevka/iosevka-extended.ttf
Normal file
BIN
assets/opensb/font/iosevka/iosevka-extended.ttf
Normal file
Binary file not shown.
BIN
assets/opensb/font/iosevka/iosevka-extendedextrabold.ttf
Normal file
BIN
assets/opensb/font/iosevka/iosevka-extendedextrabold.ttf
Normal file
Binary file not shown.
BIN
assets/opensb/font/iosevka/iosevka-extendedextraboldoblique.ttf
Normal file
BIN
assets/opensb/font/iosevka/iosevka-extendedextraboldoblique.ttf
Normal file
Binary file not shown.
BIN
assets/opensb/font/iosevka/iosevka-extendedextralight.ttf
Normal file
BIN
assets/opensb/font/iosevka/iosevka-extendedextralight.ttf
Normal file
Binary file not shown.
BIN
assets/opensb/font/iosevka/iosevka-extendedextralightoblique.ttf
Normal file
BIN
assets/opensb/font/iosevka/iosevka-extendedextralightoblique.ttf
Normal file
Binary file not shown.
BIN
assets/opensb/font/iosevka/iosevka-extendedoblique.ttf
Normal file
BIN
assets/opensb/font/iosevka/iosevka-extendedoblique.ttf
Normal file
Binary file not shown.
BIN
assets/opensb/font/iosevka/iosevka-extendedsemibold.ttf
Normal file
BIN
assets/opensb/font/iosevka/iosevka-extendedsemibold.ttf
Normal file
Binary file not shown.
BIN
assets/opensb/font/iosevka/iosevka-extendedsemiboldoblique.ttf
Normal file
BIN
assets/opensb/font/iosevka/iosevka-extendedsemiboldoblique.ttf
Normal file
Binary file not shown.
BIN
assets/opensb/font/iosevka/iosevka-extrabold.ttf
Normal file
BIN
assets/opensb/font/iosevka/iosevka-extrabold.ttf
Normal file
Binary file not shown.
BIN
assets/opensb/font/iosevka/iosevka-extraboldoblique.ttf
Normal file
BIN
assets/opensb/font/iosevka/iosevka-extraboldoblique.ttf
Normal file
Binary file not shown.
BIN
assets/opensb/font/iosevka/iosevka-extralight.ttf
Normal file
BIN
assets/opensb/font/iosevka/iosevka-extralight.ttf
Normal file
Binary file not shown.
BIN
assets/opensb/font/iosevka/iosevka-extralightoblique.ttf
Normal file
BIN
assets/opensb/font/iosevka/iosevka-extralightoblique.ttf
Normal file
Binary file not shown.
BIN
assets/opensb/font/iosevka/iosevka-oblique.ttf
Normal file
BIN
assets/opensb/font/iosevka/iosevka-oblique.ttf
Normal file
Binary file not shown.
BIN
assets/opensb/font/iosevka/iosevka-semibold.ttf
Normal file
BIN
assets/opensb/font/iosevka/iosevka-semibold.ttf
Normal file
Binary file not shown.
BIN
assets/opensb/font/iosevka/iosevka-semiboldoblique.ttf
Normal file
BIN
assets/opensb/font/iosevka/iosevka-semiboldoblique.ttf
Normal file
Binary file not shown.
BIN
assets/opensb/font/iosevka/iosevka.ttf
Normal file
BIN
assets/opensb/font/iosevka/iosevka.ttf
Normal file
Binary file not shown.
@ -14,7 +14,7 @@
|
||||
"font" : ""
|
||||
},
|
||||
|
||||
"debugFont" : "mono",
|
||||
"debugFont" : "iosevka-extrabold",
|
||||
"debugFontSize" : 7,
|
||||
"debugFontDirectives" : "?border=1;2224;0000",
|
||||
|
||||
|
@ -86,7 +86,7 @@ unsigned Font::width(String::Char c) {
|
||||
}
|
||||
|
||||
|
||||
std::pair<Image, int> Font::render(String::Char c) {
|
||||
std::pair<Image, Vec2I> Font::render(String::Char c) {
|
||||
if (!m_fontImpl)
|
||||
throw FontException("Font::render called on uninitialized font.");
|
||||
|
||||
@ -117,7 +117,7 @@ std::pair<Image, int> Font::render(String::Char c) {
|
||||
}
|
||||
}
|
||||
|
||||
return { move(image), (slot->bitmap_top - (int)height) + m_pixelSize / 4 };
|
||||
return { move(image), {slot->bitmap_left, (slot->bitmap_top - (int)height) + m_pixelSize / 4} };
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
// May return empty image on unrenderable character (Normally, this will
|
||||
// render a box, but if there is an internal freetype error this may return
|
||||
// an empty image).
|
||||
std::pair<Image, int> render(String::Char c);
|
||||
std::pair<Image, Vec2I> render(String::Char c);
|
||||
|
||||
private:
|
||||
FontImplPtr m_fontImpl;
|
||||
|
@ -67,7 +67,7 @@ const FontTextureGroup::GlyphTexture& FontTextureGroup::glyphTexture(String::Cha
|
||||
else
|
||||
res.first->second.offset = Vec2F();
|
||||
|
||||
res.first->second.offset[1] += pair.second;
|
||||
res.first->second.offset += Vec2F(pair.second);
|
||||
res.first->second.texture = m_textureGroup->create(image);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user