Indent the font test's Python harness with two spaces

This commit is contained in:
ZacharyZhang-NY committed 2026-10-05 23:59:36 -04:00
1 parent 600734790c
commit 343501011f
1 file changed
+16 -16
+16 -16
View File
@@ -48,23 +48,23 @@ fc.FcPatternAddCharSet.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_vo
fc.FcFontMatch.restype = ctypes.c_void_p
fc.FcFontMatch.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int)]
for line in sys.stdin:
family, lang, char = line.split()
pattern = fc.FcPatternCreate()
fc.FcPatternAddString(pattern, b"family", family.encode())
if lang != "-":
fc.FcPatternAddString(pattern, b"lang", lang.encode())
if char == "families":
fc.FcConfigSubstitute(None, pattern, 0)
print(fc.FcPatternFormat(pattern, b"%{family}").decode())
continue
if char != "-":
charset = fc.FcCharSetCreate()
fc.FcCharSetAddChar(charset, int(char, 16))
fc.FcPatternAddCharSet(pattern, b"charset", charset)
family, lang, char = line.split()
pattern = fc.FcPatternCreate()
fc.FcPatternAddString(pattern, b"family", family.encode())
if lang != "-":
fc.FcPatternAddString(pattern, b"lang", lang.encode())
if char == "families":
fc.FcConfigSubstitute(None, pattern, 0)
fc.FcDefaultSubstitute(pattern)
result = ctypes.c_int()
print(fc.FcPatternFormat(fc.FcFontMatch(None, pattern, ctypes.byref(result)), b"%{family[0]}").decode())
print(fc.FcPatternFormat(pattern, b"%{family}").decode())
continue
if char != "-":
charset = fc.FcCharSetCreate()
fc.FcCharSetAddChar(charset, int(char, 16))
fc.FcPatternAddCharSet(pattern, b"charset", charset)
fc.FcConfigSubstitute(None, pattern, 0)
fc.FcDefaultSubstitute(pattern)
result = ctypes.c_int()
print(fc.FcPatternFormat(fc.FcFontMatch(None, pattern, ctypes.byref(result)), b"%{family[0]}").decode())
PY
# resolve <locale> <string|langset> reads "family lang char" lines