Skip to content

Commit

Permalink
#256 font creator tool now nearly working.
Browse files Browse the repository at this point in the history
  • Loading branch information
davetcc committed Nov 21, 2022
1 parent 0aaa7e7 commit 4871194
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ private void internalGenerate(FontEncoder.FontFormat format) {
int totalHeight = rawGlyph.toBaseLine() + rawGlyph.belowBaseline();
glyphsInBlock.add(new TcUnicodeFontGlyph(i, rawGlyph.data(), rawGlyph.fontDims().width(),
rawGlyph.fontDims().height(), rawGlyph.totalWidth(),
rawGlyph.fontDims().startX(), rawGlyph.fontDims().startY()));
rawGlyph.fontDims().startX(), -(totalHeight - rawGlyph.fontDims().startY())));
if(totalHeight > maxY) {
maxY = totalHeight;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void encodeFontToStream(OutputStream stream, FontFormat fmt) {
}

private void encodeAdafruit(PrintStream ps) {
ps.println("const uint8_t " + fontName + "Bitmaps[] PROGMEM {");
ps.println("const uint8_t " + fontName + "Bitmaps[] PROGMEM = {");
List<TcUnicodeFontGlyph> allGlyphs = itemsFromAllBlocks();
printByteArray(ps, allGlyphs);
ps.println("};");
Expand Down Expand Up @@ -79,7 +79,7 @@ private void encodeTcUnicode(PrintStream ps) {
var blockData = new ArrayList<String>();
for(var block : blocks) {
ps.println("// Bitmaps for " + block.mapping());
ps.printf("const uint8_t %sBitmaps_%d[] PROGMEM {", fontName, block.mapping().ordinal());
ps.printf("const uint8_t %sBitmaps_%d[] PROGMEM = {", fontName, block.mapping().ordinal());
ps.println();
printByteArray(ps, block.glyphs());
ps.println("};");
Expand Down

0 comments on commit 4871194

Please sign in to comment.