Skip to content

Commit cb76984

Browse files
committed
1.0.14
1 parent 143b31d commit cb76984

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

RELEASES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Releases
22

3+
## 1.0.14
4+
5+
* Added a [FONTNAME]_SIZE define to fontconv.
6+
37
## 1.0.13
48

59
* Fixes issues in UTF-8 and UTF-16 decoder logic.

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mcu-renderer",
3-
"version": "1.0.13",
3+
"version": "1.0.14",
44
"keywords": "antialiased, color-displays, display-driver, embedded-systems, font, graphics-library, lcd-display, microcontrollers, monochrome-displays, oled-display, renderer, text, tft-display",
55
"description": "A C-language graphics library, focused on rendering non-flickering, anti-aliased text with low resource use on both monochrome and color LCD displays.",
66
"license": "MIT",

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=mcu-renderer
2-
version=1.0.13
2+
version=1.0.14
33
author=Gissio
44
maintainer=Gissio
55
sentence=A low-resource graphics library, focused on rendering non-flickering, anti-aliased text on both monochrome and color LCD displays.

tools/fontconv.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def __init__(self):
4545
self.codepoint_set = ''
4646
self.variable_name = ''
4747

48+
self.size = None
4849
self.cap_height = None
4950
self.ascent = None
5051
self.descent = None
@@ -188,7 +189,9 @@ def load_bitmap_font(path, codepoint_set, font_variable_name):
188189

189190
font.add_glyph(bdf_glyph.codepoint, glyph)
190191

191-
# Ascent, descent, cap height
192+
# Size, ascent, descent, cap height
193+
font.size = get_bdf_property(
194+
bdf_font, 'POINT_SIZE', bdf_font.ptSize)
192195
font.ascent = get_bdf_property(
193196
bdf_font, 'FONT_ASCENT', font.boundingbox_top.max)
194197
font.descent = get_bdf_property(
@@ -273,7 +276,8 @@ def load_vector_font(path, codepoint_set, font_variable_name, pixels, pixel_bitn
273276

274277
font.add_glyph(codepoint, glyph)
275278

276-
# Ascent, descent, cap height
279+
# Size, ascent, descent, cap height
280+
font.size = int(pixels)
277281
font.cap_height = (face.size.ascender + face.size.descender) // 64
278282
font.ascent = face.size.ascender // 64
279283
font.descent = -face.size.descender // 64
@@ -623,6 +627,7 @@ def write_encoded_font(font, encoded_font, path):
623627

624628
file.write(f'#include <stdint.h>\n\n')
625629

630+
file.write(f'#define {define_name}_SIZE {font.size}\n')
626631
file.write(f'#define {define_name}_ASCENT {font.ascent}\n')
627632
file.write(f'#define {define_name}_DESCENT {font.descent}\n')
628633
file.write(f'#define {define_name}_CAP_HEIGHT {font.cap_height}\n')

0 commit comments

Comments
 (0)