fix(bookerly): fix getReaderFontId anchor to work without smallerfonts resolve() wrapper

This commit is contained in:
Justin Oros
2026-04-22 18:00:02 -07:00
parent f7e292cb03
commit c2a59f22e5
+15 -5
View File
@@ -201,12 +201,22 @@ def patch_cross_point_settings_cpp(repo_dir, new_ids):
' return resolve(BOOKERLY_12_FONT_ID);\n'
)
content = content.replace(
anchor = None
for candidate in [
' case EXTRA_LARGE:\n return resolve(OPENDYSLEXIC_14_FONT_ID);\n }\n }\n}\n',
' case EXTRA_LARGE:\n return resolve(OPENDYSLEXIC_14_FONT_ID);\n }\n'
+ bookerly_case +
' }\n}\n'
)
' case EXTRA_LARGE:\n return OPENDYSLEXIC_14_FONT_ID;\n }\n }\n}\n',
]:
if candidate in content:
anchor = candidate
break
if anchor:
content = content.replace(
anchor,
' case EXTRA_LARGE:\n return ' + ('resolve(OPENDYSLEXIC_14_FONT_ID)' if 'resolve' in anchor else 'OPENDYSLEXIC_14_FONT_ID') + ';\n }\n'
+ bookerly_case +
' }\n}\n'
)
write_file(path, content)
print(" CrossPointSettings.cpp patched.")