Indent the font test's Python harness with two spaces
This commit is contained in:
1 parent
600734790c
commit
343501011f
1 file changed
+16
-16
@@ -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.restype = ctypes.c_void_p
|
||||||
fc.FcFontMatch.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int)]
|
fc.FcFontMatch.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.POINTER(ctypes.c_int)]
|
||||||
for line in sys.stdin:
|
for line in sys.stdin:
|
||||||
family, lang, char = line.split()
|
family, lang, char = line.split()
|
||||||
pattern = fc.FcPatternCreate()
|
pattern = fc.FcPatternCreate()
|
||||||
fc.FcPatternAddString(pattern, b"family", family.encode())
|
fc.FcPatternAddString(pattern, b"family", family.encode())
|
||||||
if lang != "-":
|
if lang != "-":
|
||||||
fc.FcPatternAddString(pattern, b"lang", lang.encode())
|
fc.FcPatternAddString(pattern, b"lang", lang.encode())
|
||||||
if char == "families":
|
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)
|
|
||||||
fc.FcConfigSubstitute(None, pattern, 0)
|
fc.FcConfigSubstitute(None, pattern, 0)
|
||||||
fc.FcDefaultSubstitute(pattern)
|
print(fc.FcPatternFormat(pattern, b"%{family}").decode())
|
||||||
result = ctypes.c_int()
|
continue
|
||||||
print(fc.FcPatternFormat(fc.FcFontMatch(None, pattern, ctypes.byref(result)), b"%{family[0]}").decode())
|
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
|
PY
|
||||||
|
|
||||||
# resolve <locale> <string|langset> reads "family lang char" lines
|
# resolve <locale> <string|langset> reads "family lang char" lines
|
||||||
|
|||||||
Reference in new issue
Block a user