fix(bookerly): use fallback anchor for bookerlyStyle field insertion in fresh repo

This commit is contained in:
Justin Oros
2026-04-22 16:19:05 -07:00
parent d3d443ce7f
commit 5c4fb9143e
2 changed files with 11 additions and 90 deletions
+11 -4
View File
@@ -181,10 +181,17 @@ def patch_cross_point_settings_h(repo_dir):
'enum FONT_FAMILY { NOTOSERIF = 0, NOTOSANS = 1, OPENDYSLEXIC = 2, BOOKERLY = 3, FONT_FAMILY_COUNT };'
)
content = content.replace(
' uint8_t smallerFontsMode = 0;',
' uint8_t smallerFontsMode = 0;\n uint8_t bookerlyStyle = 0;'
)
if 'uint8_t bookerlyStyle' not in content:
anchor = None
for candidate in [
' uint8_t smallerFontsMode = 0;',
' uint8_t imageRendering = IMAGES_DISPLAY;',
]:
if candidate in content:
anchor = candidate
break
if anchor:
content = content.replace(anchor, anchor + '\n uint8_t bookerlyStyle = 0;')
write_file(path, content)
print(" CrossPointSettings.h patched.")