Merge branch 'main' into HVF

This commit is contained in:
Behdad Esfahbod committed 2025-07-08 18:01:14 -06:00
commit 614cf09634
13 files changed
+74 -61

No files matched your search

+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@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
sarif_file: results.sarif
+7
View File
@@ -491,6 +491,9 @@ endif ()
## Define harfbuzz library
add_library(harfbuzz ${project_sources} ${project_extra_sources} ${project_headers})
target_link_libraries(harfbuzz ${THIRD_PARTY_LIBS})
if (MINGW)
target_compile_options(harfbuzz PRIVATE "-Wa,-mbig-obj")
endif()
target_include_directories(harfbuzz PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/harfbuzz>")
@@ -534,6 +537,10 @@ if (HB_BUILD_SUBSET)
target_link_libraries(harfbuzz-subset harfbuzz ${THIRD_PARTY_LIBS})
set_target_properties(harfbuzz-subset PROPERTIES VISIBILITY_INLINES_HIDDEN TRUE)
if (MINGW)
target_compile_options(harfbuzz-subset PRIVATE "-Wa,-mbig-obj")
endif()
if (BUILD_SHARED_LIBS)
if (BUILD_FRAMEWORK)
set_target_properties(harfbuzz harfbuzz-subset PROPERTIES
+5 -8
View File
@@ -24,6 +24,11 @@
release tarballs.
</para>
</abstract>
<releaseinfo>
This document is for HarfBuzz &version;.
The latest version of this documentation can be found on-line at
<ulink role="online-location" url="https://harfbuzz.github.io">https://harfbuzz.github.io</ulink>.
</releaseinfo>
</bookinfo>
<part id="user-manual">
@@ -42,14 +47,6 @@
</part>
<part id="reference-manual">
<partinfo>
<releaseinfo>
This document is for HarfBuzz &version;.
<!--The latest version of this documentation can be found on-line at
<ulink role="online-location" url="http://[SERVER]/libharfbuzz/index.html">http://[SERVER]/libharfbuzz/</ulink>.-->
</releaseinfo>
</partinfo>
<title>Reference manual</title>
<chapter id="core-api">
<title>Core API</title>
+55
View File
@@ -161,6 +161,58 @@ _hb_directwrite_table_data_release (void *data)
hb_free (context);
}
static hb_blob_t *
_hb_directwrite_get_file_blob (IDWriteFontFace *dw_face)
{
UINT32 file_count;
if (FAILED (dw_face->GetFiles(&file_count, NULL)))
return nullptr;
IDWriteFontFile **files = new IDWriteFontFile*[file_count];
if (FAILED (dw_face->GetFiles(&file_count, files)))
{
delete [] files;
return nullptr;
}
hb_blob_t *blob = nullptr;
for (UINT32 i = 0; i < file_count; i++)
{
LPCVOID reference_key;
UINT32 reference_key_size;
if (FAILED (files[i]->GetReferenceKey(&reference_key, &reference_key_size)))
continue;
IDWriteFontFileLoader *loader;
if (FAILED (files[i]->GetLoader(&loader)))
continue;
IDWriteFontFileStream *stream;
if (FAILED (loader->CreateStreamFromKey (reference_key, reference_key_size, &stream)))
{
loader->Release ();
continue;
}
UINT64 file_size;
const void *fragment;
void *context;
if (FAILED (stream->GetFileSize(&file_size)) ||
FAILED (stream->ReadFileFragment (&fragment, 0, file_size, &context)))
{
loader->Release ();
continue;
}
blob = hb_blob_create ((const char *) fragment, file_size, HB_MEMORY_MODE_DUPLICATE, NULL, NULL);
stream->ReleaseFileFragment (context);
loader->Release ();
break;
}
delete [] files;
return blob;
}
static hb_blob_t *
_hb_directwrite_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data)
{
@@ -169,6 +221,9 @@ _hb_directwrite_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *
uint32_t length;
void *table_context;
BOOL exists;
if (tag == HB_TAG_NONE)
return _hb_directwrite_get_file_blob (dw_face);
if (FAILED (dw_face->TryGetFontTable (hb_uint32_swap (tag), &data,
&length, &table_context, &exists)))
return nullptr;
+1 -2
View File
@@ -169,8 +169,7 @@ _hb_face_builder_get_table_tags (const hb_face_t *face HB_UNUSED,
if (unlikely (start_offset >= population))
{
if (table_count)
*table_count = 0;
*table_count = 0;
return population;
}
-8
View File
@@ -127,11 +127,7 @@ hb_glib_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
hb_codepoint_t *ab,
void *user_data HB_UNUSED)
{
#if GLIB_CHECK_VERSION(2,29,12)
return g_unichar_compose (a, b, ab);
#else
return false;
#endif
}
static hb_bool_t
@@ -141,11 +137,7 @@ hb_glib_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
hb_codepoint_t *b,
void *user_data HB_UNUSED)
{
#if GLIB_CHECK_VERSION(2,29,12)
return g_unichar_decompose (ab, a, b);
#else
return false;
#endif
}
-6
View File
@@ -31,12 +31,6 @@
/* g++ didn't like older gtype.h gcc-only code path. */
#include <glib.h>
#if !GLIB_CHECK_VERSION(2,29,16)
#undef __GNUC__
#undef __GNUC_MINOR__
#define __GNUC__ 2
#define __GNUC_MINOR__ 6
#endif
#include "hb-gobject.h"
-6
View File
@@ -51,12 +51,6 @@
/* g++ didn't like older gtype.h gcc-only code path. */
#include <glib.h>
#if !GLIB_CHECK_VERSION(2,29,16)
#undef __GNUC__
#undef __GNUC_MINOR__
#define __GNUC__ 2
#define __GNUC_MINOR__ 6
#endif
#include "hb-gobject.h"
+4 -4
View File
@@ -293,10 +293,10 @@ pub unsafe extern "C" fn _hb_harfrust_shape_rs(
if hr_info.safe_to_insert_tatweel() {
info.mask |= hb_glyph_flags_t_HB_GLYPH_FLAG_SAFE_TO_INSERT_TATWEEL;
}
pos.x_advance = (hr_pos.x_advance as f32 * x_scale).round() as hb_position_t;
pos.y_advance = (hr_pos.y_advance as f32 * y_scale).round() as hb_position_t;
pos.x_offset = (hr_pos.x_offset as f32 * x_scale).round() as hb_position_t;
pos.y_offset = (hr_pos.y_offset as f32 * y_scale).round() as hb_position_t;
pos.x_advance = (hr_pos.x_advance as f32 * x_scale + 0.5).floor() as hb_position_t;
pos.y_advance = (hr_pos.y_advance as f32 * y_scale + 0.5).floor() as hb_position_t;
pos.x_offset = (hr_pos.x_offset as f32 * x_scale + 0.5).floor() as hb_position_t;
pos.y_offset = (hr_pos.y_offset as f32 * y_scale + 0.5).floor() as hb_position_t;
}
true as hb_bool_t
-9
View File
@@ -127,19 +127,10 @@ hb_test_normalize_path (const char *path)
}
#if GLIB_CHECK_VERSION(2,25,12)
typedef GTestFunc hb_test_func_t;
typedef GTestDataFunc hb_test_data_func_t;
typedef GTestFixtureFunc hb_test_fixture_func_t;
#else
typedef void (*hb_test_func_t) (void);
typedef void (*hb_test_data_func_t) (gconstpointer user_data);
typedef void (*hb_test_fixture_func_t) (gpointer fixture, gconstpointer user_data);
#endif
#if !GLIB_CHECK_VERSION(2,30,0)
#define g_test_fail() g_error("Test failed")
#endif
#ifndef g_assert_true
#define g_assert_true g_assert
#endif
-8
View File
@@ -5,13 +5,6 @@ subdir('data/text-rendering-tests') # text_rendering_tests
shape_run_tests_py = find_program('run-tests.py')
env = environment()
env.set('HAVE_FREETYPE', '@0@'.format(conf.get('HAVE_FREETYPE', 0)))
env.set('HAVE_FONTATIONS', '@0@'.format(conf.get('HAVE_FONTATIONS', 0)))
env.set('HAVE_CORETEXT', '@0@'.format(conf.get('HAVE_CORETEXT', 0)))
env.set('HAVE_DIRECTWRITE', '@0@'.format(conf.get('HAVE_DIRECTWRITE', 0)))
env.set('HAVE_UNISCRIBE', '@0@'.format(conf.get('HAVE_UNISCRIBE', 0)))
sets = ['in-house', 'aots', 'text-rendering-tests']
foreach set : sets
# in-house -> in_house_tests, aots -> aots_tests, text-rendering-tests -> text_rendering_tests
@@ -29,7 +22,6 @@ foreach set : sets
],
protocol: 'tap',
#verbose: true,
env: env,
workdir: meson.current_build_dir() / '..' / '..',
suite: ['shape', set],
)
+1 -5
View File
@@ -46,8 +46,7 @@
#endif
#ifdef CAIRO_HAS_PS_SURFACE
# include <cairo-ps.h>
# if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,6,0)
# define HAS_EPS 1
# define HAS_EPS 1
static cairo_surface_t *
_cairo_eps_surface_create_for_stream (cairo_write_func_t write_func,
@@ -63,9 +62,6 @@ _cairo_eps_surface_create_for_stream (cairo_write_func_t write_func,
return surface;
}
# else
# undef HAS_EPS
# endif
#endif
#ifdef CAIRO_HAS_SCRIPT_SURFACE
# include <cairo-script.h>
-4
View File
@@ -76,11 +76,7 @@ struct view_cairo_t : view_options_t, output_options_t<>
helper_cairo_line_t &line = g_array_index (lines, helper_cairo_line_t, i);
line.finish ();
}
#if GLIB_CHECK_VERSION (2, 22, 0)
g_array_unref (lines);
#else
g_array_free (lines, TRUE);
#endif
}
protected: