Skip to content

Commit

Permalink
BMFont: few fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Cpasjuste committed Dec 24, 2022
1 parent da6f116 commit ab40713
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
10 changes: 5 additions & 5 deletions data/common/romfs/future.bmfc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ fileVersion=1
fontName=This Is The Future
fontFile=
charSet=0
fontSize=-20
fontSize=-18
aa=1
scaleH=100
useSmoothing=1
Expand All @@ -23,10 +23,10 @@ autoFitFontSizeMin=0
autoFitFontSizeMax=0

# character alignment
paddingDown=0
paddingUp=0
paddingRight=0
paddingLeft=0
paddingDown=1
paddingUp=1
paddingRight=1
paddingLeft=1
spacingHoriz=1
spacingVert=1
useFixedHeight=0
Expand Down
Binary file modified data/common/romfs/future.fnt
Binary file not shown.
Binary file modified data/common/romfs/future_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ int main(int argc, char *argv[]) {
// create a text
auto font = new Font();
font->loadFromFile(renderer->getIo()->getRomFsPath() + "future.ttf");
auto text = new Text("libcross2d @ Cpasjuste", 20, font);
auto text = new Text("libcross2d @ Cpasjuste", 18, font);
text->setFillColor(Color::Yellow);
text->setOutlineThickness(2);
text->setPosition(renderer->getSize().x - 8, renderer->getSize().y - 8);
text->setOrigin(Origin::BottomRight);
Expand All @@ -55,9 +56,9 @@ int main(int argc, char *argv[]) {
// create a bitmap text (https://www.angelcode.com/products/bmfont/)
auto bmFont = new BMFont();
bmFont->loadFromFile(renderer->getIo()->getRomFsPath() + "future.fnt");
auto bmText = new Text("libcross2d @ Cpasjuste", 20, bmFont);
auto bmText = new Text("libcross2d @ Cpasjuste", 18, bmFont);
bmText->setFillColor(Color::Red);
bmText->setPosition(renderer->getSize().x - 8, renderer->getSize().y - 40);
bmText->setPosition(renderer->getSize().x - 8, renderer->getSize().y - 36);
bmText->setOrigin(Origin::BottomRight);
renderer->add(bmText);

Expand Down

0 comments on commit ab40713

Please sign in to comment.