Merge branch 'main' into HVF

This commit is contained in:
Behdad Esfahbod committed 2025-05-06 10:37:40 -06:00
commit b3e6bd20e2
24 files changed
+900 -756

No files matched your search

+3 -3
View File
@@ -81,7 +81,7 @@ ninja==1.11.1.4 \
# via -r requirements.in
# The following packages are considered to be unsafe in a requirements file:
setuptools==79.0.0 \
--hash=sha256:9828422e7541213b0aacb6e10bbf9dd8febeaa45a48570e09b6d100e063fc9f9 \
--hash=sha256:b9ab3a104bedb292323f53797b00864e10e434a3ab3906813a7169e4745b912a
setuptools==80.3.1 \
--hash=sha256:31e2c58dbb67c99c289f51c16d899afedae292b978f8051efaf6262d8212f927 \
--hash=sha256:ea8e00d7992054c4c592aeb892f6ad51fe1b4d90cc6947cc45c45717c40ec537
# via -r requirements.in
+2 -2
View File
@@ -18,7 +18,7 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Ccache
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
uses: hendrikmuhs/ccache-action@63069e3931dedbf3b63792097479563182fe70d1 # v1.2.18
with:
key: ${{ github.job }}-${{ runner.os }}-${{ runner.arch }}
- uses: dtolnay/rust-toolchain@nightly
@@ -43,7 +43,7 @@ jobs:
pkg-config \
bindgen
- name: Setup Python
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.12'
- name: Install Python Dependencies
+2 -2
View File
@@ -18,7 +18,7 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Ccache
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
uses: hendrikmuhs/ccache-action@63069e3931dedbf3b63792097479563182fe70d1 # v1.2.18
with:
key: ${{ github.job }}-${{ runner.os }}-${{ runner.arch }}
- name: Install Dependencies
@@ -37,7 +37,7 @@ jobs:
pkg-config \
help2man
- name: Setup Python
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.12'
- name: Install Python Dependencies
+2 -2
View File
@@ -17,7 +17,7 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Ccache
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
uses: hendrikmuhs/ccache-action@63069e3931dedbf3b63792097479563182fe70d1 # v1.2.18
with:
key: ${{ github.job }}-${{ runner.os }}-${{ runner.arch }}
- name: Install Dependencies
@@ -36,7 +36,7 @@ jobs:
ninja \
pkgconf
- name: Setup Python
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.12'
- name: Install Python Dependencies
+2 -2
View File
@@ -30,12 +30,12 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Ccache
uses: hendrikmuhs/ccache-action@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
uses: hendrikmuhs/ccache-action@63069e3931dedbf3b63792097479563182fe70d1 # v1.2.18
with:
variant: sccache
key: ${{ github.job }}-${{ matrix.os }}-${{ matrix.ARCH }}
- name: Setup Python
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.12'
- name: Setup MSVC
+1 -1
View File
@@ -59,6 +59,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
uses: github/codeql-action/upload-sarif@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
with:
sarif_file: results.sarif
+533 -528
View File
File diff suppressed because it is too large. Load diff
+1
View File
@@ -121,6 +121,7 @@
<index id="api-index-full"><title>API Index</title><xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include></index>
<index id="deprecated-api-index"><title>Index of deprecated API</title><xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include></index>
<index id="api-index-11-2-0"><title>Index of new symbols in 11.2.0</title><xi:include href="xml/api-index-11.2.0.xml"><xi:fallback /></xi:include></index>
<index id="api-index-11-0-0"><title>Index of new symbols in 11.0.0</title><xi:include href="xml/api-index-11.0.0.xml"><xi:fallback /></xi:include></index>
<index id="api-index-10-4-0"><title>Index of new symbols in 10.4.0</title><xi:include href="xml/api-index-10.4.0.xml"><xi:fallback /></xi:include></index>
<index id="api-index-10-3-0"><title>Index of new symbols in 10.3.0</title><xi:include href="xml/api-index-10.3.0.xml"><xi:fallback /></xi:include></index>
+1 -1
View File
@@ -1,6 +1,6 @@
project('harfbuzz', ['c', 'cpp'],
meson_version: '>= 0.60.0',
version: '11.1.0',
version: '11.2.0',
default_options: [
'cpp_eh=none', # Just to support msvc, we are passing -fno-exceptions also anyway
# 'cpp_rtti=false', # Do NOT enable, wraps inherit it and ICU needs RTTI
+4 -4
View File
@@ -14,15 +14,15 @@ option('graphite', type: 'feature', value: 'disabled',
option('graphite2', type: 'feature', value: 'disabled',
description: 'Enable Graphite2 complementary shaper')
option('freetype', type: 'feature', value: 'auto',
description: 'Enable freetype interop helpers')
description: 'Enable freetype font backend')
option('fontations', type: 'feature', value: 'disabled',
description: 'Enabled fontations font functions')
description: 'Enable fontations font backend')
option('gdi', type: 'feature', value: 'disabled',
description: 'Enable GDI helpers and Uniscribe shaper backend (Windows only)')
option('directwrite', type: 'feature', value: 'disabled',
description: 'Enable DirectWrite shaper backend on Windows')
description: 'Enable DirectWrite shaper and font backend on Windows')
option('coretext', type: 'feature', value: 'disabled',
description: 'Enable CoreText shaper backend on macOS')
description: 'Enable CoreText shaper and font backend on Apple platforms')
option('wasm', type: 'feature', value: 'disabled',
description: 'Enable WebAssembly shaper backend (experimental)')
+31 -22
View File
@@ -1,37 +1,46 @@
#!/usr/bin/env python3
import sys, os
import os
import sys
srcdir = os.getenv ('srcdir', os.path.dirname (__file__))
base_srcdir = os.getenv ('base_srcdir', srcdir)
srcdir = sys.argv[1]
base_srcdir = sys.argv[2]
builddir = sys.argv[3]
os.chdir(srcdir)
os.chdir (srcdir)
def removeprefix(s):
abs_path = os.path.join(base_srcdir, s)
return os.path.relpath(abs_path, srcdir)
abs_path = os.path.join(base_srcdir, s)
return os.path.relpath(abs_path, srcdir)
HBHEADERS = [os.path.basename (x) for x in os.getenv ('HBHEADERS', '').split ()] or \
[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith ('.h')]
HBHEADERS = [x for x in HBHEADERS if x.endswith ('.h')]
HBSOURCES = [
removeprefix(x) for x in os.getenv ('HBSOURCES', '').split ()
] or [
x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith (('.cc', '.hh'))
HBHEADERS = [os.path.basename(x) for x in os.getenv("HBHEADERS", "").split()] or [
x for x in os.listdir(".") if x.startswith("hb") and x.endswith(".h")
]
HBHEADERS = [x for x in HBHEADERS if x.endswith(".h")]
HBSOURCES = [removeprefix(x) for x in os.getenv("HBSOURCES", "").split()] or [
x for x in os.listdir(".") if x.startswith("hb") and x.endswith((".cc", ".hh"))
]
stat = 0
for x in HBHEADERS:
with open (x, 'r', encoding='utf-8') as f: content = f.read ()
if ('HB_BEGIN_DECLS' not in content) or ('HB_END_DECLS' not in content):
print ('Ouch, file %s does not have HB_BEGIN_DECLS / HB_END_DECLS, but it should' % x)
stat = 1
print(f"Checking {x}")
with open(x, "r", encoding="utf-8") as f:
content = f.read()
if ("HB_BEGIN_DECLS" not in content) or ("HB_END_DECLS" not in content):
print(
"Ouch, file %s does not have HB_BEGIN_DECLS / HB_END_DECLS, but it should"
% x
)
stat = 1
for x in HBSOURCES:
with open (x, 'r', encoding='utf-8') as f: content = f.read ()
if ('HB_BEGIN_DECLS' in content) or ('HB_END_DECLS' in content):
print ('Ouch, file %s has HB_BEGIN_DECLS / HB_END_DECLS, but it shouldn\'t' % x)
stat = 1
print(f"Checking {x}")
with open(x, "r", encoding="utf-8") as f:
content = f.read()
if ("HB_BEGIN_DECLS" in content) or ("HB_END_DECLS" in content):
print("Ouch, file %s has HB_BEGIN_DECLS / HB_END_DECLS, but it shouldn't" % x)
stat = 1
sys.exit (stat)
sys.exit(stat)
+20 -11
View File
@@ -1,20 +1,29 @@
#!/usr/bin/env python3
import sys, os, re
import os
import re
import sys
os.chdir (os.getenv ('srcdir', os.path.dirname (__file__)))
srcdir = sys.argv[1]
base_srcdir = sys.argv[2]
builddir = sys.argv[3]
HBHEADERS = [os.path.basename (x) for x in os.getenv ('HBHEADERS', '').split ()] or \
[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith ('.h')]
os.chdir(srcdir)
HBHEADERS = [os.path.basename(x) for x in os.getenv("HBHEADERS", "").split()] or [
x for x in os.listdir(".") if x.startswith("hb") and x.endswith(".h")
]
stat = 0
print ('Checking that all public symbols are exported with HB_EXTERN')
print("Checking that all public symbols are exported with HB_EXTERN")
for x in HBHEADERS:
with open (x, 'r', encoding='utf-8') as f: content = f.read ()
for s in re.findall (r'\n.+\nhb_.+\n', content):
if not s.startswith ('\nHB_EXTERN '):
print ('failure on:', s)
stat = 1
print(f"Checking {x}")
with open(x, "r", encoding="utf-8") as f:
content = f.read()
for s in re.findall(r"\n.+\nhb_.+\n", content):
if not s.startswith("\nHB_EXTERN "):
print("failure on:", s)
stat = 1
sys.exit (stat)
sys.exit(stat)
+34 -19
View File
@@ -1,34 +1,49 @@
#!/usr/bin/env python3
import sys, os, re
import os
import re
import sys
srcdir = os.getenv ('srcdir', os.path.dirname (__file__))
base_srcdir = os.getenv ('base_srcdir', srcdir)
srcdir = sys.argv[1]
base_srcdir = sys.argv[2]
builddir = sys.argv[3]
os.chdir(srcdir)
os.chdir (srcdir)
def removeprefix(s):
abs_path = os.path.join(base_srcdir, s)
return os.path.relpath(abs_path, srcdir)
abs_path = os.path.join(base_srcdir, s)
return os.path.relpath(abs_path, srcdir)
HBHEADERS = [os.path.basename (x) for x in os.getenv ('HBHEADERS', '').split ()] or \
[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith ('.h')]
HBSOURCES = [
removeprefix(x) for x in os.getenv ('HBSOURCES', '').split ()
] or [
x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith (('.cc', '.hh'))
HBHEADERS = [os.path.basename(x) for x in os.getenv("HBHEADERS", "").split()] or [
x for x in os.listdir(".") if x.startswith("hb") and x.endswith(".h")
]
HBSOURCES = [removeprefix(x) for x in os.getenv("HBSOURCES", "").split()] or [
x for x in os.listdir(".") if x.startswith("hb") and x.endswith((".cc", ".hh"))
]
stat = 0
for x in HBHEADERS + HBSOURCES:
if not x.endswith ('h') or x == 'hb-gobject-structs.h': continue
tag = x.upper ().replace ('.', '_').replace ('-', '_').replace(os.path.sep, '_').replace('/', '_')
with open (x, 'r', encoding='utf-8') as f: content = f.read ()
if len (re.findall (tag + r'\b', content)) != 3:
print ('Ouch, header file %s does not have correct preprocessor guards. Expected: %s' % (x, tag))
stat = 1
if not x.endswith("h") or x == "hb-gobject-structs.h":
continue
print(f"Checking {x}")
tag = (
x.upper()
.replace(".", "_")
.replace("-", "_")
.replace(os.path.sep, "_")
.replace("/", "_")
)
with open(x, "r", encoding="utf-8") as f:
content = f.read()
if len(re.findall(tag + r"\b", content)) != 3:
print(
"Ouch, header file %s does not have correct preprocessor guards. Expected: %s"
% (x, tag)
)
stat = 1
sys.exit (stat)
sys.exit(stat)
+45 -32
View File
@@ -1,51 +1,64 @@
#!/usr/bin/env python3
import sys, os, re
import os
import re
import sys
srcdir = os.getenv ('srcdir', os.path.dirname (__file__))
base_srcdir = os.getenv ('base_srcdir', srcdir)
srcdir = sys.argv[1]
base_srcdir = sys.argv[2]
builddir = sys.argv[3]
os.chdir(srcdir)
os.chdir (srcdir)
def removeprefix(s):
abs_path = os.path.join(base_srcdir, s)
return os.path.relpath(abs_path, srcdir)
abs_path = os.path.join(base_srcdir, s)
return os.path.relpath(abs_path, srcdir)
HBHEADERS = [os.path.basename (x) for x in os.getenv ('HBHEADERS', '').split ()] or \
[x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith ('.h')]
HBSOURCES = [
removeprefix(x) for x in os.getenv ('HBSOURCES', '').split ()
] or [
x for x in os.listdir ('.') if x.startswith ('hb') and x.endswith (('.cc', '.hh'))
HBHEADERS = [os.path.basename(x) for x in os.getenv("HBHEADERS", "").split()] or [
x for x in os.listdir(".") if x.startswith("hb") and x.endswith(".h")
]
HBSOURCES = [removeprefix(x) for x in os.getenv("HBSOURCES", "").split()] or [
x for x in os.listdir(".") if x.startswith("hb") and x.endswith((".cc", ".hh"))
]
stat = 0
print ('Checking that public header files #include "hb-common.h" or "hb.h" first (or none)')
print(
'Checking that public header files #include "hb-common.h" or "hb.h" first (or none)'
)
for x in HBHEADERS:
if x == 'hb.h' or x == 'hb-common.h': continue
with open (x, 'r', encoding='utf-8') as f: content = f.read ()
first = re.findall (r'#.*include.*', content)[0]
if first not in ['#include "hb.h"', '#include "hb-common.h"']:
print ('failure on %s' % x)
stat = 1
if x == "hb.h" or x == "hb-common.h":
continue
print(f"Checking {x}")
with open(x, "r", encoding="utf-8") as f:
content = f.read()
first = re.findall(r"#.*include.*", content)[0]
if first not in ['#include "hb.h"', '#include "hb-common.h"']:
print("failure on %s" % x)
stat = 1
print ('Checking that source files #include a private header first (or none)')
print("Checking that source files #include a private header first (or none)")
for x in HBSOURCES:
with open (x, 'r', encoding='utf-8') as f: content = f.read ()
includes = re.findall (r'#.*include.*', content)
if includes:
if not len (re.findall (r'".*\.hh"', includes[0])):
print ('failure on %s' % x)
stat = 1
print(f"Checking {x}")
with open(x, "r", encoding="utf-8") as f:
content = f.read()
includes = re.findall(r"#.*include.*", content)
if includes:
if not len(re.findall(r'".*\.hh"', includes[0])):
print("failure on %s" % x)
stat = 1
print ('Checking that there is no #include <hb-*.h>')
print("Checking that there is no #include <hb-*.h>")
for x in HBHEADERS + HBSOURCES:
with open (x, 'r', encoding='utf-8') as f: content = f.read ()
if re.findall ('#.*include.*<.*hb', content):
print ('failure on %s' % x)
stat = 1
print(f"Checking {x}")
with open(x, "r", encoding="utf-8") as f:
content = f.read()
if re.findall("#.*include.*<.*hb", content):
print("failure on %s" % x)
stat = 1
sys.exit (stat)
sys.exit(stat)
+29 -23
View File
@@ -1,39 +1,45 @@
#!/usr/bin/env python3
import sys, os, shutil, subprocess
import os
import shutil
import subprocess
import sys
os.chdir (os.getenv ('srcdir', os.path.dirname (__file__)))
srcdir = sys.argv[1]
base_srcdir = sys.argv[2]
builddir = sys.argv[3]
libs = os.getenv ('libs', '.libs')
os.chdir(srcdir)
ldd = os.getenv ('LDD', shutil.which ('ldd'))
ldd = os.getenv("LDD", shutil.which("ldd"))
if not ldd:
otool = os.getenv ('OTOOL', shutil.which ('otool'))
if otool:
ldd = otool + ' -L'
else:
print ('check-libstdc++.py: \'ldd\' not found; skipping test')
sys.exit (77)
otool = os.getenv("OTOOL", shutil.which("otool"))
if otool:
ldd = otool + " -L"
else:
print("check-libstdc++.py: 'ldd' not found; skipping test")
sys.exit(77)
stat = 0
tested = False
# harfbuzz-icu links to libstdc++ because icu does.
for soname in ['harfbuzz', 'harfbuzz-subset', 'harfbuzz-gobject', 'harfbuzz-cairo']:
for suffix in ['so', 'dylib']:
so = os.path.join (libs, 'lib%s.%s' % (soname, suffix))
if not os.path.exists (so): continue
for soname in ["harfbuzz", "harfbuzz-subset", "harfbuzz-gobject", "harfbuzz-cairo"]:
for suffix in ["so", "dylib"]:
so = os.path.join(builddir, "lib%s.%s" % (soname, suffix))
if not os.path.exists(so):
continue
print ('Checking that we are not linking to libstdc++ or libc++ in %s' % so)
ldd_result = subprocess.check_output (ldd.split() + [so])
if (b'libstdc++' in ldd_result) or (b'libc++' in ldd_result):
print ('Ouch, %s is linked to libstdc++ or libc++' % so)
stat = 1
print("Checking that we are not linking to libstdc++ or libc++ in %s" % so)
ldd_result = subprocess.check_output(ldd.split() + [so])
if (b"libstdc++" in ldd_result) or (b"libc++" in ldd_result):
print("Ouch, %s is linked to libstdc++ or libc++" % so)
stat = 1
tested = True
tested = True
if not tested:
print ('check-libstdc++.py: libharfbuzz shared library not found; skipping test')
sys.exit (77)
print("check-libstdc++.py: libharfbuzz shared library not found; skipping test")
sys.exit(77)
sys.exit (stat)
sys.exit(stat)
+37 -24
View File
@@ -1,51 +1,64 @@
#!/usr/bin/env python3
import sys, os, shutil, subprocess, glob, re
import glob
import os
import re
import shutil
import subprocess
import sys
builddir = os.getenv ('builddir', os.path.dirname (__file__))
libs = os.getenv ('libs', '.libs')
srcdir = sys.argv[1]
base_srcdir = sys.argv[2]
builddir = sys.argv[3]
objdump = os.getenv ('OBJDUMP', shutil.which ('objdump'))
objdump = os.getenv("OBJDUMP", shutil.which("objdump"))
if not objdump:
print ('check-static-inits.py: \'ldd\' not found; skipping test')
sys.exit (77)
print("check-static-inits.py: 'ldd' not found; skipping test")
sys.exit(77)
if sys.version_info < (3, 5):
print ('check-static-inits.py: needs python 3.5 for recursive support in glob')
sys.exit (77)
print("check-static-inits.py: needs python 3.5 for recursive support in glob")
sys.exit(77)
OBJS = glob.glob (os.path.join (builddir, libs, '**', '*hb*.o'), recursive=True)
OBJS = glob.glob(os.path.join(builddir, "**", "*hb*.o"), recursive=True)
if not OBJS:
print ('check-static-inits.py: object files not found; skipping test')
sys.exit (77)
print("check-static-inits.py: object files not found; skipping test")
sys.exit(77)
stat = 0
tested = 0
tested = False
result = subprocess.run(objdump.split () + ['-t'] + OBJS, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
print("Checking that the following object files has no static initializers/finalizers")
print("\n".join(OBJS))
result = subprocess.run(
objdump.split() + ["-t"] + OBJS, stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
if result.returncode:
if result.stderr.find (b'not recognized') != -1:
if result.stderr.find(b"not recognized") != -1:
# https://github.com/harfbuzz/harfbuzz/issues/3019
print ('objdump %s returned "not recognized", skipping')
print('objdump returned "not recognized", skipping')
else:
print ('objdump returned error:\n%s' % (result.stderr.decode ('utf-8')))
print("objdump returned error:\n%s" % (result.stderr.decode("utf-8")))
stat = 2
else:
tested = 1
tested = True
result = result.stdout.decode ('utf-8')
result = result.stdout.decode("utf-8")
# Checking that no object file has static initializers
for l in re.findall (r'^.*\.[cd]tors.*$', result, re.MULTILINE):
if not re.match (r'.*\b0+\b', l):
print ('Ouch, library has static initializers/finalizers')
for lib in re.findall(r"^.*\.[cd]tors.*$", result, re.MULTILINE):
if not re.match(r".*\b0+\b", lib):
print("Ouch, library has static initializers/finalizers")
stat = 1
# Checking that no object file has lazy static C++ constructors/destructors or other such stuff
if ('__cxa_' in result) and ('__ubsan_handle' not in result):
print ('Ouch, library has lazy static C++ constructors/destructors or other such stuff')
if ("__cxa_" in result) and ("__ubsan_handle" not in result):
print(
"Ouch, library has lazy static C++ constructors/destructors or other such stuff"
)
stat = 1
sys.exit (stat if tested else 77)
sys.exit(stat if tested else 77)
+99 -51
View File
@@ -1,77 +1,125 @@
#!/usr/bin/env python3
import sys, os, shutil, subprocess, re, difflib
import difflib
import os
import re
import shutil
import subprocess
import sys
os.environ['LC_ALL'] = 'C' # otherwise 'nm' prints in wrong order
os.environ["LC_ALL"] = "C" # otherwise 'nm' prints in wrong order
builddir = os.getenv ('builddir', os.path.dirname (__file__))
libs = os.getenv ('libs', '.libs')
srcdir = sys.argv[1]
base_srcdir = sys.argv[2]
builddir = sys.argv[3]
IGNORED_SYMBOLS = ['_fini', '_init', '_fdata', '_ftext', '_fbss',
'__bss_start', '__bss_start__', '__bss_end__', '_edata', '_end', '_bss_end__',
'__end__', '__gcov_.*', 'llvm_.*', 'flush_fn_list', 'writeout_fn_list', 'mangle_path',
'lprofDirMode', 'reset_fn_list']
IGNORED_SYMBOLS = [
"_fini",
"_init",
"_fdata",
"_ftext",
"_fbss",
"__bss_start",
"__bss_start__",
"__bss_end__",
"_edata",
"_end",
"_bss_end__",
"__end__",
"__gcov_.*",
"llvm_.*",
"flush_fn_list",
"writeout_fn_list",
"mangle_path",
"lprofDirMode",
"reset_fn_list",
]
# Rust
IGNORED_SYMBOLS += [
'rust_eh_personality',
'_ZN3std9panicking11EMPTY_PANIC.*', # 'std::panicking::EMPTY_PANIC::.*'
'_ZN3std3sys3pal4unix4args3imp15ARGV_INIT_ARRAY.*', # 'std::sys::pal::unix::args::imp::ARGV_INIT_ARRAY::.*'
'_ZN3std3sys4args4unix3imp15ARGV_INIT_ARRAY.*', # std::sys::args::unix::imp::ARGV_INIT_ARRAY::.*
'_ZN17compiler_builtins.*', # 'compiler_builtins::.*'
"rust_eh_personality",
"_ZN3std9panicking11EMPTY_PANIC.*", # 'std::panicking::EMPTY_PANIC::.*'
"_ZN3std3sys3pal4unix4args3imp15ARGV_INIT_ARRAY.*", # 'std::sys::pal::unix::args::imp::ARGV_INIT_ARRAY::.*'
"_ZN3std3sys4args4unix3imp15ARGV_INIT_ARRAY.*", # std::sys::args::unix::imp::ARGV_INIT_ARRAY::.*
"_ZN17compiler_builtins.*", # 'compiler_builtins::.*'
]
IGNORED_SYMBOLS = '|'.join (IGNORED_SYMBOLS)
IGNORED_SYMBOLS = "|".join(IGNORED_SYMBOLS)
nm = os.getenv ('NM', shutil.which ('nm'))
nm = os.getenv("NM", shutil.which("nm"))
if not nm:
print ('check-symbols.py: \'nm\' not found; skipping test')
sys.exit (77)
print("check-symbols.py: 'nm' not found; skipping test")
sys.exit(77)
tested = False
stat = 0
for soname in ['harfbuzz', 'harfbuzz-subset', 'harfbuzz-icu', 'harfbuzz-gobject', 'harfbuzz-cairo']:
for suffix in ['so', 'dylib']:
so = os.path.join (builddir, libs, 'lib%s.%s' % (soname, suffix))
if not os.path.exists (so): continue
for soname in [
"harfbuzz",
"harfbuzz-subset",
"harfbuzz-icu",
"harfbuzz-gobject",
"harfbuzz-cairo",
]:
for suffix in ["so", "dylib"]:
so = os.path.join(builddir, "lib%s.%s" % (soname, suffix))
if not os.path.exists(so):
continue
# On macOS, C symbols are prefixed with _
symprefix = '_' if suffix == 'dylib' else ''
# On macOS, C symbols are prefixed with _
symprefix = "_" if suffix == "dylib" else ""
EXPORTED_SYMBOLS = [s.split ()[2]
for s in re.findall (r'^.+ [BCDGIRSTu] .+$', subprocess.check_output (nm.split() + [so]).decode ('utf-8'), re.MULTILINE)
if not re.match (r'.* %s(%s)\b' % (symprefix, IGNORED_SYMBOLS), s)]
EXPORTED_SYMBOLS = [
s.split()[2]
for s in re.findall(
r"^.+ [BCDGIRSTu] .+$",
subprocess.check_output(nm.split() + [so]).decode("utf-8"),
re.MULTILINE,
)
if not re.match(r".* %s(%s)\b" % (symprefix, IGNORED_SYMBOLS), s)
]
prefix = (symprefix + os.path.basename (so)).replace ('libharfbuzz', 'hb').replace ('-', '_').split ('.')[0]
prefix = (
(symprefix + os.path.basename(so))
.replace("libharfbuzz", "hb")
.replace("-", "_")
.split(".")[0]
)
print ('Checking that %s does not expose internal symbols' % so)
suspicious_symbols = [x for x in EXPORTED_SYMBOLS if not re.match (r'^%s(_|$)' % prefix, x)]
if suspicious_symbols:
print ('Ouch, internal symbols exposed:', suspicious_symbols)
stat = 1
print("Checking that %s does not expose internal symbols" % so)
suspicious_symbols = [
x for x in EXPORTED_SYMBOLS if not re.match(r"^%s(_|$)" % prefix, x)
]
if suspicious_symbols:
print("Ouch, internal symbols exposed:", suspicious_symbols)
stat = 1
def_path = os.path.join (builddir, soname + '.def')
if not os.path.exists (def_path):
print ('\'%s\' not found; skipping' % def_path)
else:
print ('Checking that %s has the same symbol list as %s' % (so, def_path))
with open (def_path, 'r', encoding='utf-8') as f: def_file = f.read ()
diff_result = list (difflib.context_diff (
def_file.splitlines (),
['EXPORTS'] + [re.sub ('^%shb' % symprefix, 'hb', x) for x in EXPORTED_SYMBOLS] +
# cheat: copy the last line from the def file!
[def_file.splitlines ()[-1]]
))
def_path = os.path.join(builddir, soname + ".def")
if not os.path.exists(def_path):
print("'%s' not found; skipping" % def_path)
else:
print("Checking that %s has the same symbol list as %s" % (so, def_path))
with open(def_path, "r", encoding="utf-8") as f:
def_file = f.read()
diff_result = list(
difflib.context_diff(
def_file.splitlines(),
["EXPORTS"]
+ [re.sub("^%shb" % symprefix, "hb", x) for x in EXPORTED_SYMBOLS]
+
# cheat: copy the last line from the def file!
[def_file.splitlines()[-1]],
)
)
if diff_result:
print ('\n'.join (diff_result))
stat = 1
if diff_result:
print("\n".join(diff_result))
stat = 1
tested = True
tested = True
if not tested:
print ('check-symbols.py: no shared libraries found; skipping test')
sys.exit (77)
print("check-symbols.py: no shared libraries found; skipping test")
sys.exit(77)
sys.exit (stat)
sys.exit(stat)
+10 -8
View File
@@ -365,12 +365,12 @@ ct_apply_func (void *info, const CGPathElement *element)
}
}
static void
hb_coretext_draw_glyph (hb_font_t *font,
void *font_data HB_UNUSED,
hb_codepoint_t glyph,
hb_draw_funcs_t *draw_funcs, void *draw_data,
void *user_data)
static hb_bool_t
hb_coretext_draw_glyph_or_fail (hb_font_t *font,
void *font_data HB_UNUSED,
hb_codepoint_t glyph,
hb_draw_funcs_t *draw_funcs, void *draw_data,
void *user_data)
{
CTFontRef ct_font = (CTFontRef) (const void *) font->data.coretext;
@@ -383,13 +383,15 @@ hb_coretext_draw_glyph (hb_font_t *font,
CGPathRef path = CTFontCreatePathForGlyph (ct_font, glyph, &transform);
if (!path)
return;
return false;
hb_draw_session_t drawing {draw_funcs, draw_data};
CGPathApply (path, &drawing, ct_apply_func);
CFRelease (path);
return true;
}
#endif
@@ -469,7 +471,7 @@ static struct hb_coretext_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t
#endif
#ifndef HB_NO_DRAW
hb_font_funcs_set_draw_glyph_func (funcs, hb_coretext_draw_glyph, nullptr, nullptr);
hb_font_funcs_set_draw_glyph_or_fail_func (funcs, hb_coretext_draw_glyph_or_fail, nullptr, nullptr);
#endif
hb_font_funcs_set_glyph_extents_func (funcs, hb_coretext_get_glyph_extents, nullptr, nullptr);
+11 -3
View File
@@ -205,10 +205,18 @@ create_cg_font (hb_blob_t *blob, unsigned int index)
if (unlikely (named_instance_index != 0))
{
// https://github.com/harfbuzz/harfbuzz/issues/5300
#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) || \
(defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || \
(defined(__TV_OS_VERSION_MIN_REQUIRED) && __TV_OS_VERSION_MIN_REQUIRED >= 110000) || \
(defined(__WATCH_OS_VERSION_MIN_REQUIRED) && __WATCH_OS_VERSION_MIN_REQUIRED >= 40000) || \
(defined(__MACCATALYST_VERSION_MIN_REQUIRED) && __MACCATALYST_VERSION_MIN_REQUIRED >= 130100) || \
(defined(__VISION_OS_VERSION_MIN_REQUIRED) && __VISION_OS_VERSION_MIN_REQUIRED >= 10000)
auto ct_font_desc_array = CTFontManagerCreateFontDescriptorsFromData (CFDataCreate (kCFAllocatorDefault, (const UInt8 *) blob_data, blob_length));
if (unlikely (!ct_font_desc_array))
return nullptr;
return create_cg_font (ct_font_desc_array, named_instance_index);
if (likely (ct_font_desc_array))
return create_cg_font (ct_font_desc_array, named_instance_index);
#endif
return nullptr;
}
hb_blob_reference (blob);
+12 -12
View File
@@ -275,12 +275,12 @@ public:
}
};
static void
hb_directwrite_draw_glyph (hb_font_t *font,
void *font_data HB_UNUSED,
hb_codepoint_t glyph,
hb_draw_funcs_t *draw_funcs, void *draw_data,
void *user_data)
static hb_bool_t
hb_directwrite_draw_glyph_or_fail (hb_font_t *font,
void *font_data HB_UNUSED,
hb_codepoint_t glyph,
hb_draw_funcs_t *draw_funcs, void *draw_data,
void *user_data)
{
IDWriteFontFace *dw_face = (IDWriteFontFace *) (const void *) font->data.directwrite;
@@ -288,11 +288,11 @@ hb_directwrite_draw_glyph (hb_font_t *font,
UINT16 gid = static_cast<UINT16>(glyph);
unsigned upem = font->face->get_upem();
(void) dw_face->GetGlyphRunOutline (upem,
&gid, nullptr, nullptr,
1,
false, false,
&sink);
return S_OK == dw_face->GetGlyphRunOutline (upem,
&gid, nullptr, nullptr,
1,
false, false,
&sink);
}
#endif
@@ -317,7 +317,7 @@ static struct hb_directwrite_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loade
#endif
#ifndef HB_NO_DRAW
hb_font_funcs_set_draw_glyph_func (funcs, hb_directwrite_draw_glyph, nullptr, nullptr);
hb_font_funcs_set_draw_glyph_or_fail_func (funcs, hb_directwrite_draw_glyph_or_fail, nullptr, nullptr);
#endif
hb_font_funcs_set_glyph_extents_func (funcs, hb_directwrite_get_glyph_extents, nullptr, nullptr);
+10
View File
@@ -497,6 +497,7 @@ struct hb_font_t
/* Try getting extents from paint(), then draw(), *then* get_extents()
* and apply synthetic settings in the last case. */
#ifndef HB_NO_PAINT
hb_paint_extents_context_t paint_extents;
if (paint_glyph_or_fail (glyph,
hb_paint_extents_get_funcs (), &paint_extents,
@@ -505,7 +506,9 @@ struct hb_font_t
*extents = paint_extents.get_extents ().to_glyph_extents ();
return true;
}
#endif
#ifndef HB_NO_DRAW
hb_extents_t<> draw_extents;
if (draw_glyph_or_fail (glyph,
hb_draw_extents_get_funcs (), &draw_extents))
@@ -513,6 +516,7 @@ struct hb_font_t
*extents = draw_extents.to_glyph_extents ();
return true;
}
#endif
bool ret = klass->get.f.glyph_extents (this, user_data,
glyph,
@@ -576,6 +580,7 @@ struct hb_font_t
hb_draw_funcs_t *draw_funcs, void *draw_data,
bool synthetic = true)
{
#ifndef HB_NO_DRAW
#ifndef HB_NO_OUTLINE
bool embolden = x_strength || y_strength;
bool slanted = slant_xy;
@@ -619,6 +624,8 @@ struct hb_font_t
return true;
#endif
#endif
return false;
}
bool paint_glyph_or_fail (hb_codepoint_t glyph,
@@ -627,6 +634,7 @@ struct hb_font_t
hb_color_t foreground,
bool synthetic = true)
{
#ifndef HB_NO_PAINT
/* Slant */
if (synthetic && slant_xy)
hb_paint_push_transform (paint_funcs, paint_data,
@@ -644,6 +652,8 @@ struct hb_font_t
hb_paint_pop_transform (paint_funcs, paint_data);
return ret;
#endif
return false;
}
/* A bit higher-level, and with fallback */
+2 -2
View File
@@ -47,7 +47,7 @@ HB_BEGIN_DECLS
*
* The minor component of the library version available at compile-time.
*/
#define HB_VERSION_MINOR 1
#define HB_VERSION_MINOR 2
/**
* HB_VERSION_MICRO:
*
@@ -60,7 +60,7 @@ HB_BEGIN_DECLS
*
* A string literal containing the library version available at compile-time.
*/
#define HB_VERSION_STRING "11.1.0"
#define HB_VERSION_STRING "11.2.0"
/**
* HB_VERSION_ATLEAST:
+5 -4
View File
@@ -1040,10 +1040,6 @@ if get_option('tests').enabled()
]
env = environment()
env.set('srcdir', meson.current_source_dir())
env.set('base_srcdir', meson.project_source_root())
env.set('builddir', meson.current_build_dir())
env.set('libs', meson.current_build_dir()) # TODO: Merge this with builddir after autotools removal
HBSOURCES = []
foreach f : hb_sources
if meson.version().version_compare('>=1.4.0')
@@ -1071,6 +1067,11 @@ if get_option('tests').enabled()
foreach name : dist_check_script
test(name, find_program(name + '.py'),
env: env,
args: [
meson.current_source_dir(),
meson.project_source_root(),
meson.current_build_dir(),
],
depends: name == 'check-symbols' ? defs_list : [],
suite: ['src'],
)
+4
View File
@@ -79,6 +79,10 @@ test_native_coretext_variations (void)
unsigned int length;
// System UI font is a variable font
#if !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) && MAC_OS_X_VERSION_MIN_REQUIRED < 1080
# define kCTFontUIFontSystem kCTFontSystemFontType
# define kCTFontUIFontEmphasizedSystem kCTFontEmphasizedSystemFontType
#endif
ctfont = CTFontCreateUIFontForLanguage (kCTFontUIFontSystem, 12.0, CFSTR ("en-US"));
g_assert_nonnull (ctfont);