mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-28 17:19:17 +01:00
[svg] Share svgz normalization across raster and vector
Vector SVG extraction still treated SVG table documents as plain text, so svgz payloads worked in raster but failed in hb-vector. Move the gzip helpers into a new internal hb-zlib.hh header and add a shared SVG blob normalization helper in svg.hh. Raster and vector now both normalize SVG documents before doc-cache or rendering/subsetting logic sees them, with the same 16 MiB uncompressed size limit. Also link zlib into harfbuzz-vector when available and add a vector regression that checks matching output for the existing plain and compressed handwriting SVG fonts. Tested: - meson test -C build Assisted-by: OpenAI Codex
This commit is contained in:
1 parent
e948ac9a3a
commit
00da68ef5c
7 files changed
+270
-179
No files matched your search
@@ -27,8 +27,10 @@
|
||||
|
||||
#include "../../../hb-open-type.hh"
|
||||
#include "../../../hb-blob.hh"
|
||||
#include "../../../hb-limits.hh"
|
||||
#include "../../../hb-map.hh"
|
||||
#include "../../../hb-paint.hh"
|
||||
#include "../../../hb-zlib.hh"
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -562,6 +564,55 @@ parse_cache_entries_linear (const char *svg,
|
||||
|
||||
} /* namespace _hb_svg_cache_impl */
|
||||
|
||||
static inline hb_blob_t *
|
||||
hb_ot_svg_reference_normalized_blob (hb_blob_t *image,
|
||||
const char **svg,
|
||||
unsigned *len)
|
||||
{
|
||||
hb_blob_t *blob = hb_blob_reference (image);
|
||||
unsigned data_len = 0;
|
||||
const char *data = hb_blob_get_data (blob, &data_len);
|
||||
|
||||
if (!data || !data_len)
|
||||
goto fail;
|
||||
|
||||
if (hb_blob_is_gzip (data, data_len))
|
||||
{
|
||||
uint32_t expected_size = 0;
|
||||
if (hb_gzip_get_uncompressed_size (data, data_len, &expected_size) &&
|
||||
unlikely ((size_t) expected_size > (size_t) HB_SVG_MAX_DOCUMENT_SIZE))
|
||||
goto fail;
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
hb_blob_t *uncompressed = hb_blob_decompress_gzip (blob,
|
||||
HB_SVG_MAX_DOCUMENT_SIZE);
|
||||
if (!uncompressed)
|
||||
goto fail;
|
||||
|
||||
hb_blob_destroy (blob);
|
||||
blob = uncompressed;
|
||||
data = hb_blob_get_data (blob, &data_len);
|
||||
if (!data || !data_len)
|
||||
goto fail;
|
||||
#else
|
||||
goto fail;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (unlikely ((size_t) data_len > (size_t) HB_SVG_MAX_DOCUMENT_SIZE))
|
||||
goto fail;
|
||||
|
||||
if (svg) *svg = data;
|
||||
if (len) *len = data_len;
|
||||
return blob;
|
||||
|
||||
fail:
|
||||
hb_blob_destroy (blob);
|
||||
if (svg) *svg = nullptr;
|
||||
if (len) *len = 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
inline
|
||||
SVG::accelerator_t::accelerator_t (hb_face_t *face)
|
||||
{
|
||||
|
||||
+5
-141
@@ -37,127 +37,15 @@
|
||||
#include "hb-raster-svg-bbox.hh"
|
||||
#include "hb-raster-svg-fill.hh"
|
||||
#include "hb-raster-svg-use.hh"
|
||||
#include "OT/Color/svg/svg.hh"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_ZLIB
|
||||
#include <zlib.h>
|
||||
#endif
|
||||
|
||||
#ifndef HB_NO_RASTER_SVG
|
||||
|
||||
#define SVG_MAX_DEPTH 32
|
||||
|
||||
static inline bool
|
||||
hb_raster_svg_blob_is_gzip (const char *data,
|
||||
unsigned data_len)
|
||||
{
|
||||
return data_len >= 3 &&
|
||||
(unsigned char) data[0] == 0x1Fu &&
|
||||
(unsigned char) data[1] == 0x8Bu &&
|
||||
(unsigned char) data[2] == 0x08u;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
hb_raster_svg_gzip_get_uncompressed_size (const char *data,
|
||||
unsigned data_len,
|
||||
uint32_t *size)
|
||||
{
|
||||
if (data_len < 4)
|
||||
return false;
|
||||
|
||||
const unsigned char *trailer = (const unsigned char *) data + data_len - 4;
|
||||
if (size)
|
||||
*size = (uint32_t) trailer[0] |
|
||||
((uint32_t) trailer[1] << 8) |
|
||||
((uint32_t) trailer[2] << 16) |
|
||||
((uint32_t) trailer[3] << 24);
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
static hb_blob_t *
|
||||
hb_raster_svg_decompress_blob (hb_blob_t *blob)
|
||||
{
|
||||
unsigned compressed_len = 0;
|
||||
const uint8_t *compressed = (const uint8_t *) hb_blob_get_data (blob, &compressed_len);
|
||||
if (!compressed || !compressed_len)
|
||||
return nullptr;
|
||||
|
||||
z_stream stream = {};
|
||||
stream.next_in = (Bytef *) compressed;
|
||||
stream.avail_in = compressed_len;
|
||||
|
||||
if (inflateInit2 (&stream, 16 + MAX_WBITS) != Z_OK)
|
||||
return nullptr;
|
||||
|
||||
uint32_t expected_size = 0;
|
||||
hb_raster_svg_gzip_get_uncompressed_size ((const char *) compressed,
|
||||
compressed_len,
|
||||
&expected_size);
|
||||
|
||||
size_t allocated = hb_min ((size_t) hb_max (expected_size, 4096u),
|
||||
(size_t) HB_SVG_MAX_DOCUMENT_SIZE);
|
||||
char *output = (char *) hb_malloc (allocated);
|
||||
if (!output)
|
||||
{
|
||||
inflateEnd (&stream);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int status = Z_OK;
|
||||
while (true)
|
||||
{
|
||||
size_t produced = (size_t) stream.total_out;
|
||||
if (unlikely (produced >= (size_t) HB_SVG_MAX_DOCUMENT_SIZE))
|
||||
goto fail;
|
||||
|
||||
if (produced == allocated)
|
||||
{
|
||||
size_t new_allocated = hb_min (allocated * 2, (size_t) HB_SVG_MAX_DOCUMENT_SIZE);
|
||||
if (unlikely (new_allocated <= allocated))
|
||||
goto fail;
|
||||
|
||||
char *new_output = (char *) hb_realloc (output, new_allocated);
|
||||
if (unlikely (!new_output))
|
||||
goto fail;
|
||||
|
||||
output = new_output;
|
||||
allocated = new_allocated;
|
||||
}
|
||||
|
||||
stream.next_out = (Bytef *) output + stream.total_out;
|
||||
stream.avail_out = (uInt) (allocated - (size_t) stream.total_out);
|
||||
|
||||
status = inflate (&stream, Z_FINISH);
|
||||
if (status == Z_STREAM_END)
|
||||
break;
|
||||
|
||||
if ((status == Z_OK || status == Z_BUF_ERROR) && stream.avail_out == 0)
|
||||
continue;
|
||||
|
||||
goto fail;
|
||||
}
|
||||
|
||||
inflateEnd (&stream);
|
||||
|
||||
if (unlikely ((size_t) stream.total_out > (size_t) HB_SVG_MAX_DOCUMENT_SIZE))
|
||||
goto fail_free;
|
||||
|
||||
return hb_blob_create_or_fail (output,
|
||||
(unsigned) stream.total_out,
|
||||
HB_MEMORY_MODE_WRITABLE,
|
||||
output,
|
||||
hb_free);
|
||||
|
||||
fail:
|
||||
inflateEnd (&stream);
|
||||
fail_free:
|
||||
hb_free (output);
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 11. Element renderer — recursive SVG rendering
|
||||
*/
|
||||
@@ -547,7 +435,7 @@ hb_raster_svg_render (hb_raster_paint_t *paint,
|
||||
hb_color_t foreground)
|
||||
{
|
||||
bool ret = false;
|
||||
hb_blob_t *render_blob = hb_blob_reference (blob);
|
||||
hb_blob_t *render_blob = nullptr;
|
||||
hb_face_t *face HB_UNUSED = hb_font_get_face (font);
|
||||
const OT::SVG::svg_doc_cache_t *doc_cache = nullptr;
|
||||
#ifndef HB_NO_SVG
|
||||
@@ -565,33 +453,9 @@ hb_raster_svg_render (hb_raster_paint_t *paint,
|
||||
#endif
|
||||
|
||||
unsigned data_len = 0;
|
||||
const char *data = hb_blob_get_data (render_blob, &data_len);
|
||||
if (!data_len)
|
||||
goto done;
|
||||
|
||||
if (hb_raster_svg_blob_is_gzip (data, data_len))
|
||||
{
|
||||
uint32_t expected_size = 0;
|
||||
if (hb_raster_svg_gzip_get_uncompressed_size (data, data_len, &expected_size) &&
|
||||
unlikely ((size_t) expected_size > (size_t) HB_SVG_MAX_DOCUMENT_SIZE))
|
||||
goto done;
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
hb_blob_t *uncompressed = hb_raster_svg_decompress_blob (render_blob);
|
||||
if (!uncompressed)
|
||||
goto done;
|
||||
|
||||
hb_blob_destroy (render_blob);
|
||||
render_blob = uncompressed;
|
||||
data = hb_blob_get_data (render_blob, &data_len);
|
||||
if (!data_len)
|
||||
goto done;
|
||||
#else
|
||||
goto done;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (unlikely ((size_t) data_len > (size_t) HB_SVG_MAX_DOCUMENT_SIZE))
|
||||
const char *data = nullptr;
|
||||
render_blob = OT::hb_ot_svg_reference_normalized_blob (blob, &data, &data_len);
|
||||
if (!render_blob || !data_len)
|
||||
goto done;
|
||||
|
||||
#ifndef HB_NO_SVG
|
||||
|
||||
+49
-37
@@ -262,47 +262,55 @@ hb_svg_subset_glyph_image (hb_face_t *face,
|
||||
hb_vector_t<char> *defs_dst,
|
||||
hb_vector_t<char> *body_dst)
|
||||
{
|
||||
if (glyph == HB_CODEPOINT_INVALID || !image_counter || !defs_dst || !body_dst)
|
||||
return false;
|
||||
|
||||
unsigned len;
|
||||
const char *svg = hb_blob_get_data (image, &len);
|
||||
if (!svg || !len)
|
||||
return false;
|
||||
|
||||
bool ret = false;
|
||||
hb_blob_t *normalized_image = nullptr;
|
||||
unsigned len = 0;
|
||||
const char *svg = nullptr;
|
||||
unsigned doc_index = 0;
|
||||
if (!hb_ot_color_glyph_get_svg_document_index (face, glyph, &doc_index))
|
||||
return false;
|
||||
|
||||
hb_codepoint_t start_glyph = HB_CODEPOINT_INVALID;
|
||||
hb_codepoint_t end_glyph = HB_CODEPOINT_INVALID;
|
||||
if (!hb_ot_color_get_svg_document_glyph_range (face, doc_index, &start_glyph, &end_glyph))
|
||||
return false;
|
||||
const OT::SVG::svg_doc_cache_t *doc_cache = nullptr;
|
||||
unsigned glyph_start = 0, glyph_end = 0;
|
||||
const hb_vector_t<OT::SVG::svg_defs_entry_t> *defs_entries = nullptr;
|
||||
hb_vector_t<OT::SVG::svg_id_span_t> needed_ids;
|
||||
hb_hashmap_t<OT::SVG::svg_id_span_t, hb_bool_t> needed_ids_set;
|
||||
hb_vector_t<unsigned> chosen_defs;
|
||||
hb_vector_t<uint8_t> chosen_def_marks;
|
||||
char prefix[32];
|
||||
int prefix_len = 0;
|
||||
|
||||
auto *doc_cache = face->table.SVG->get_or_create_doc_cache (image, svg, len,
|
||||
doc_index, start_glyph, end_glyph);
|
||||
if (glyph == HB_CODEPOINT_INVALID || !image_counter || !defs_dst || !body_dst)
|
||||
goto done;
|
||||
|
||||
normalized_image = OT::hb_ot_svg_reference_normalized_blob (image, &svg, &len);
|
||||
if (!normalized_image || !svg || !len)
|
||||
goto done;
|
||||
|
||||
if (!hb_ot_color_glyph_get_svg_document_index (face, glyph, &doc_index))
|
||||
goto done;
|
||||
|
||||
if (!hb_ot_color_get_svg_document_glyph_range (face, doc_index, &start_glyph, &end_glyph))
|
||||
goto done;
|
||||
|
||||
doc_cache = face->table.SVG->get_or_create_doc_cache (normalized_image, svg, len,
|
||||
doc_index, start_glyph, end_glyph);
|
||||
if (!doc_cache)
|
||||
return false;
|
||||
goto done;
|
||||
svg = face->table.SVG->doc_cache_get_svg (doc_cache, &len);
|
||||
|
||||
unsigned glyph_start = 0, glyph_end = 0;
|
||||
if (!face->table.SVG->doc_cache_get_glyph_span (doc_cache, glyph, &glyph_start, &glyph_end))
|
||||
return false;
|
||||
goto done;
|
||||
|
||||
auto *defs_entries = face->table.SVG->doc_cache_get_defs_entries (doc_cache);
|
||||
defs_entries = face->table.SVG->doc_cache_get_defs_entries (doc_cache);
|
||||
|
||||
hb_vector_t<OT::SVG::svg_id_span_t> needed_ids;
|
||||
needed_ids.alloc (16);
|
||||
hb_hashmap_t<OT::SVG::svg_id_span_t, hb_bool_t> needed_ids_set;
|
||||
if (!hb_svg_collect_refs (svg + glyph_start, glyph_end - glyph_start,
|
||||
&needed_ids, &needed_ids_set))
|
||||
return false;
|
||||
goto done;
|
||||
|
||||
hb_vector_t<unsigned> chosen_defs;
|
||||
chosen_defs.alloc (16);
|
||||
hb_vector_t<uint8_t> chosen_def_marks;
|
||||
if (unlikely (!chosen_def_marks.resize ((int) defs_entries->length)))
|
||||
return false;
|
||||
goto done;
|
||||
hb_memset (chosen_def_marks.arrayZ, 0, defs_entries->length);
|
||||
for (unsigned qi = 0; qi < needed_ids.length; qi++)
|
||||
{
|
||||
@@ -316,20 +324,19 @@ hb_svg_subset_glyph_image (hb_face_t *face,
|
||||
{
|
||||
chosen_def_marks.arrayZ[i] = 1;
|
||||
if (unlikely (!chosen_defs.push_or_fail (i)))
|
||||
return false;
|
||||
goto done;
|
||||
if (!hb_svg_collect_refs (svg + e.start, e.end - e.start,
|
||||
&needed_ids, &needed_ids_set))
|
||||
return false;
|
||||
goto done;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
char prefix[32];
|
||||
int prefix_len = snprintf (prefix, sizeof (prefix), "hbimg%u_", (*image_counter)++);
|
||||
prefix_len = snprintf (prefix, sizeof (prefix), "hbimg%u_", (*image_counter)++);
|
||||
if (prefix_len <= 0 || (unsigned) prefix_len >= sizeof (prefix))
|
||||
return false;
|
||||
goto done;
|
||||
|
||||
body_dst->alloc (body_dst->length + (glyph_end - glyph_start) + (unsigned) prefix_len + 32);
|
||||
|
||||
@@ -337,15 +344,20 @@ hb_svg_subset_glyph_image (hb_face_t *face,
|
||||
{
|
||||
const auto &e = defs_entries->arrayZ[chosen_defs.arrayZ[i]];
|
||||
if (!hb_svg_append_with_prefix (defs_dst, svg + e.start, e.end - e.start, prefix, (unsigned) prefix_len))
|
||||
return false;
|
||||
if (!hb_svg_append_c (defs_dst, '\n')) return false;
|
||||
goto done;
|
||||
if (!hb_svg_append_c (defs_dst, '\n'))
|
||||
goto done;
|
||||
}
|
||||
|
||||
return hb_svg_append_with_prefix (body_dst,
|
||||
svg + glyph_start,
|
||||
glyph_end - glyph_start,
|
||||
prefix,
|
||||
(unsigned) prefix_len);
|
||||
ret = hb_svg_append_with_prefix (body_dst,
|
||||
svg + glyph_start,
|
||||
glyph_end - glyph_start,
|
||||
prefix,
|
||||
(unsigned) prefix_len);
|
||||
|
||||
done:
|
||||
hb_blob_destroy (normalized_image);
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
bool
|
||||
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Copyright © 2026 Behdad Esfahbod
|
||||
*
|
||||
* This is part of HarfBuzz, a text shaping library.
|
||||
*
|
||||
* Permission is hereby granted, without written agreement and without
|
||||
* license or royalty fees, to use, copy, modify, and distribute this
|
||||
* software and its documentation for any purpose, provided that the
|
||||
* above copyright notice and the following two paragraphs appear in
|
||||
* all copies of this software.
|
||||
*
|
||||
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
|
||||
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
|
||||
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
* DAMAGE.
|
||||
*
|
||||
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
|
||||
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
|
||||
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
|
||||
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||
*/
|
||||
|
||||
#ifndef HB_ZLIB_HH
|
||||
#define HB_ZLIB_HH
|
||||
|
||||
#include "hb-blob.hh"
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
#include <zlib.h>
|
||||
#endif
|
||||
|
||||
static inline bool
|
||||
hb_blob_is_gzip (const char *data,
|
||||
unsigned data_len)
|
||||
{
|
||||
return data_len >= 3 &&
|
||||
(unsigned char) data[0] == 0x1Fu &&
|
||||
(unsigned char) data[1] == 0x8Bu &&
|
||||
(unsigned char) data[2] == 0x08u;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
hb_gzip_get_uncompressed_size (const char *data,
|
||||
unsigned data_len,
|
||||
uint32_t *size)
|
||||
{
|
||||
if (data_len < 4)
|
||||
return false;
|
||||
|
||||
const unsigned char *trailer = (const unsigned char *) data + data_len - 4;
|
||||
if (size)
|
||||
*size = (uint32_t) trailer[0] |
|
||||
((uint32_t) trailer[1] << 8) |
|
||||
((uint32_t) trailer[2] << 16) |
|
||||
((uint32_t) trailer[3] << 24);
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef HAVE_ZLIB
|
||||
static inline hb_blob_t *
|
||||
hb_blob_decompress_gzip (hb_blob_t *blob,
|
||||
unsigned max_output_len)
|
||||
{
|
||||
unsigned compressed_len = 0;
|
||||
const uint8_t *compressed = (const uint8_t *) hb_blob_get_data (blob, &compressed_len);
|
||||
if (!compressed || !compressed_len)
|
||||
return nullptr;
|
||||
|
||||
z_stream stream = {};
|
||||
stream.next_in = (Bytef *) compressed;
|
||||
stream.avail_in = compressed_len;
|
||||
|
||||
if (inflateInit2 (&stream, 16 + MAX_WBITS) != Z_OK)
|
||||
return nullptr;
|
||||
|
||||
uint32_t expected_size = 0;
|
||||
hb_gzip_get_uncompressed_size ((const char *) compressed,
|
||||
compressed_len,
|
||||
&expected_size);
|
||||
|
||||
size_t allocated = hb_min ((size_t) hb_max (expected_size, 4096u),
|
||||
(size_t) max_output_len);
|
||||
char *output = (char *) hb_malloc (allocated);
|
||||
if (!output)
|
||||
{
|
||||
inflateEnd (&stream);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int status = Z_OK;
|
||||
while (true)
|
||||
{
|
||||
size_t produced = (size_t) stream.total_out;
|
||||
if (unlikely (produced >= (size_t) max_output_len))
|
||||
goto fail;
|
||||
|
||||
if (produced == allocated)
|
||||
{
|
||||
size_t new_allocated = hb_min (allocated * 2, (size_t) max_output_len);
|
||||
if (unlikely (new_allocated <= allocated))
|
||||
goto fail;
|
||||
|
||||
char *new_output = (char *) hb_realloc (output, new_allocated);
|
||||
if (unlikely (!new_output))
|
||||
goto fail;
|
||||
|
||||
output = new_output;
|
||||
allocated = new_allocated;
|
||||
}
|
||||
|
||||
stream.next_out = (Bytef *) output + stream.total_out;
|
||||
stream.avail_out = (uInt) (allocated - (size_t) stream.total_out);
|
||||
|
||||
status = inflate (&stream, Z_FINISH);
|
||||
if (status == Z_STREAM_END)
|
||||
break;
|
||||
|
||||
if ((status == Z_OK || status == Z_BUF_ERROR) && stream.avail_out == 0)
|
||||
continue;
|
||||
|
||||
goto fail;
|
||||
}
|
||||
|
||||
inflateEnd (&stream);
|
||||
|
||||
if (unlikely ((size_t) stream.total_out > (size_t) max_output_len))
|
||||
goto fail_free;
|
||||
|
||||
return hb_blob_create_or_fail (output,
|
||||
(unsigned) stream.total_out,
|
||||
HB_MEMORY_MODE_WRITABLE,
|
||||
output,
|
||||
hb_free);
|
||||
|
||||
fail:
|
||||
inflateEnd (&stream);
|
||||
fail_free:
|
||||
hb_free (output);
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* HB_ZLIB_HH */
|
||||
+7
-1
@@ -273,6 +273,7 @@ hb_base_sources = files(
|
||||
'hb-unicode.hh',
|
||||
'hb-utf.hh',
|
||||
'hb-vector.hh',
|
||||
'hb-zlib.hh',
|
||||
'hb.hh',
|
||||
)
|
||||
|
||||
@@ -804,9 +805,14 @@ endif
|
||||
|
||||
libharfbuzz_vector_dep = null_dep
|
||||
if not get_option('vector').disabled()
|
||||
vector_deps = [m_dep]
|
||||
if zlib_dep.found()
|
||||
vector_deps += [zlib_dep]
|
||||
endif
|
||||
|
||||
libharfbuzz_vector = library('harfbuzz-vector', hb_vector_sources,
|
||||
include_directories: incconfig,
|
||||
dependencies: [m_dep],
|
||||
dependencies: vector_deps,
|
||||
link_with: [libharfbuzz],
|
||||
cpp_args: cpp_args + extra_hb_cpp_args,
|
||||
soversion: hb_so_version,
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-16 -966 1307 1232" width="1307" height="1232">
|
||||
<defs>
|
||||
|
||||
<path id="hbimg0_b" d="m74.79 63.14c-2.06-0.62-4.03-1.08-5.93-1.38-7.78-1.23-14.15 0.24-19.16 4.2-4.84 3.83-22.37 16.31-30.06 24.5-3.67 3.92-0.25 8.33 2.94 10.32 6.25 3.92 12.5 3.61 26.08-4.63 6.94-4.21 11.39-0.7 16.32 2.67 0 0 7.71 6.39 14.5 8.78 2.67 0.94 6.73 0.94 11.01 0.11-20.12-0.34-28.01-39.39-28.01-39.39s-0.01-4.12 12.31-5.18z"/>
|
||||
<g id="cg0">
|
||||
<g id="hbimg0_glyph7" transform="matrix(9.375 0 0 9.375 37.5 -950)"><radialGradient id="hbimg0_e" cx="34.77" cy="46.297" r="48.535" gradientTransform="matrix(1.0274 0 0 1.0036 -9.0068 3.4483)" gradientUnits="userSpaceOnUse"><stop stop-color="#FFCA28" offset=".3533"/><stop stop-color="#FFB300" offset=".7665"/></radialGradient><path d="m124 72.49c0-3-2.43-5.46-5.52-5.61-2.48-0.12-8.65 1.45-12.14-0.19-8.61-4.05-44.1-22.73-44.1-22.73-3.12-1.69-10.77-4.19-14.65-3.22l-28.3 11.28c-2.76 0.69-5 2.36-6.43 4.53-1.04 1.18-2.18 9.38-3.74 16.83s-3.47 12.38-3.47 12.38c-1.54 5.68 2.95 9.49 6.94 10.17s9.21-1.77 10.75-7.46l3.28-15.74c0.53-2.56 2.64-4.52 5.28-4.91l9.97 0.36-3.51 17.95s17.76 22.73 42.87 28.12c9.21 1.98 17.78-3.78 24.38-4.19 3.05-0.19 9.39 0.48 12.18 1.29 3.1 0.9 6.22-1.38 6.22-4.51v-34.35z" fill="url(#hbimg0_e)"/><path d="m87.7 115.75c-6.36-0.12-16.11-3.73-22.81-6.67-4.95-2.17-10.58-2.39-15.69-0.58l-5.13 1.81c-4.87 1.72-10.33 0.1-13.37-3.97l-10.07-13.47 84.05-0.17s-1.54 23.35-16.98 23.05z" fill="#fa0"/><path d="m40.57 72.75 15.02-24.84-0.1 4.15c-0.1 4.24 2.67 8.05 6.83 9.4l-21.75 11.29z" fill="#EDA600"/><path d="m23.62 110.95-17.18 12.7c-1.22 0.9-2.74-0.07-2.39-1.53l4.73-19.74c0.11-0.45 0.29-0.9 0.54-1.3l56.96-94.86c1.21-2.01 3.68-2.81 5.52-1.77l8.77 4.95c1.84 1.04 2.35 3.51 1.14 5.53l-56.86 94.65c-0.31 0.54-0.73 1.01-1.23 1.37z" fill="#1E88E5"/><path d="m49.64 43.52c3.42 0 8.81 1.79 11.21 3.09 1.45 0.76 35.64 18.76 44.22 22.79 1.49 0.7 3.33 1.04 5.63 1.04 1.76 0 3.48-0.19 5-0.36 0.99-0.11 1.93-0.21 2.5-0.21h0.14c1.49 0.07 2.66 1.22 2.66 2.61v34.35c0 1.03-0.95 1.71-1.83 1.71-0.18 0-0.37-0.03-0.55-0.08-2.92-0.85-8.58-1.44-11.83-1.44-0.5 0-0.96 0.01-1.37 0.04-2.84 0.18-5.77 1.13-8.87 2.15l-0.61 0.2c-0.41 0.13-0.79 0.36-1.11 0.65-1.94 1.8-4.18 2.68-6.83 2.68h-0.24c-4.61-0.09-12.71-2.49-21.67-6.42-3.1-1.36-6.39-2.05-9.79-2.05-2.77 0-5.5 0.47-8.1 1.39l-5.13 1.81c-0.96 0.34-1.96 0.51-2.97 0.51-2.77 0-5.38-1.29-7-3.44l-1.36-1.81c-0.57-0.76-1.46-1.2-2.4-1.2-0.1 0-0.19 0-0.29 0.01-0.3 0.03-0.6 0.04-0.88 0.04-2.9 0-3.96-1.47-4.5-2.58-0.77-1.55-0.86-3.15-0.29-4.73 0.23-0.63 0.23-1.3 0.04-1.91 0.65-0.08 1.27-0.38 1.76-0.87 0.7-0.71 1.51-1.32 2.42-1.81 0.04-0.02 0.07-0.04 0.1-0.06l13.6-8.09c0.73-0.44 1.25-1.16 1.41-2l2.11-10.77c0.18-0.93-0.08-1.89-0.72-2.59-0.57-0.63-1.38-0.99-2.22-0.99-0.09 0-0.19 0-0.28 0.01l-8.56 0.81c-0.05 0.01-0.11 0.01-0.16 0.02-3.81 0.56-6.9 3.4-7.75 7.09l-4.65 14.44c-0.01 0.04-0.03 0.09-0.04 0.13-0.05 0.2-0.12 0.41-0.22 0.68-0.23 0.64-0.24 1.31-0.05 1.92-0.63 0.08-1.23 0.36-1.71 0.82-1.24 1.21-2.95 1.93-4.56 1.93-0.28 0-0.56-0.02-0.82-0.07-1.63-0.28-3.23-1.3-4.07-2.62-0.68-1.07-0.86-2.31-0.51-3.68 0.36-0.96 2.09-5.74 3.54-12.67 0.5-2.4 0.95-4.8 1.38-7.13 0.62-3.35 1.39-7.51 1.86-8.56 0.02-0.03 0.05-0.07 0.07-0.1 1.08-1.63 2.74-2.8 4.66-3.28 0.13-0.03 0.26-0.07 0.38-0.12l28.08-11.2c0.26-0.03 0.64-0.08 1.17-0.08m0-3c-0.75 0-1.44 0.07-2.04 0.22l-28.3 11.28c-2.76 0.69-5 2.36-6.43 4.53-1.04 1.18-2.18 9.38-3.74 16.83-1.56 7.46-3.47 12.37-3.47 12.37-1.54 5.68 2.95 9.49 6.94 10.17 0.43 0.07 0.87 0.11 1.32 0.11 2.27 0 4.74-0.92 6.65-2.78-0.8 2.22-0.75 4.68 0.43 7.07 1.5 3.04 4.18 4.25 7.19 4.25 0.39 0 0.78-0.02 1.17-0.06l1.36 1.81c2.23 2.98 5.76 4.65 9.4 4.65 1.33 0 2.67-0.22 3.97-0.68l5.13-1.81c2.3-0.81 4.7-1.21 7.1-1.21 2.93 0 5.86 0.6 8.59 1.8 6.7 2.94 16.46 6.55 22.81 6.67h0.29c3.72 0 6.62-1.39 8.87-3.48 3.17-1.03 6.11-2.04 8.74-2.21 0.35-0.02 0.75-0.03 1.19-0.03 3.29 0 8.53 0.61 10.99 1.32 0.47 0.14 0.93 0.2 1.39 0.2 2.58 0 4.83-2.05 4.83-4.71v-34.34c0-3-2.43-5.46-5.52-5.61-0.09 0-0.19-0.01-0.28-0.01-1.69 0-4.68 0.57-7.5 0.57-1.6 0-3.13-0.18-4.35-0.75-8.61-4.05-44.1-22.73-44.1-22.73-2.66-1.43-8.54-3.44-12.63-3.44zm-26.6 48.87c0.11-0.3 0.21-0.6 0.3-0.92l4.7-14.57c0.53-2.56 2.64-4.52 5.28-4.91l8.55-0.8-2.11 10.77-13.6 8.09c-1.18 0.65-2.23 1.44-3.12 2.34z" fill="#EDA600"/><linearGradient id="hbimg0_d" x1="67.412" x2="15.176" y1="18.589" y2="112.62" gradientUnits="userSpaceOnUse"><stop stop-color="#64B5F6" offset="0"/><stop stop-color="#2196F3" offset="1"/></linearGradient><path d="m23.62 110.95-17.18 12.7c-1.22 0.9-2.74-0.07-2.39-1.53l4.73-19.74c0.11-0.45 0.29-0.9 0.54-1.3l56.96-94.86c1.21-2.01 3.68-2.81 5.52-1.77l8.77 4.95c1.84 1.04 2.35 3.51 1.14 5.53l-56.86 94.65c-0.31 0.54-0.73 1.01-1.23 1.37z" fill="url(#hbimg0_d)"/><g opacity=".2"><path d="m70.04 7c0.11 0 0.21 0.02 0.29 0.07l8.77 4.95c0.04 0.02 0.17 0.1 0.24 0.34 0.04 0.15 0.1 0.54-0.2 1.03l-56.86 94.66c-0.12 0.19-0.27 0.37-0.45 0.5l-13.91 10.28 3.77-15.75c0.04-0.16 0.1-0.31 0.19-0.46l56.98-94.85c0.31-0.53 0.82-0.77 1.18-0.77m0-3c-1.44 0-2.91 0.81-3.76 2.22l-56.97 94.85c-0.25 0.41-0.43 0.85-0.54 1.3l-4.73 19.74c-0.25 1.08 0.5 1.89 1.4 1.89 0.33 0 0.68-0.11 1-0.35l17.18-12.7c0.5-0.37 0.92-0.83 1.24-1.37l56.86-94.65c1.21-2.01 0.7-4.49-1.14-5.53l-8.77-4.95c-0.55-0.3-1.16-0.45-1.77-0.45z" fill="#424242"/></g><radialGradient id="hbimg0_c" cx="73.325" cy="81.096" r="35.227" gradientTransform="matrix(1.0356 0 0 1.0036 -12.354 3.4483)" gradientUnits="userSLine truncated
|
||||
<clipPath id="hbimg0_a"><use xlink:href="#hbimg0_b"/></clipPath><g clip-path="url(#hbimg0_a)"><path d="m63.72 64.34c2.32 0 4.84 0.32 7.52 0.95-2.64 14.23 1.87 28.66 12.39 40.02-1.56-0.07-2.57-0.32-3.17-0.53-6.19-2.18-13.51-8.2-13.58-8.26s-0.14-0.11-0.22-0.17l-0.68-0.47c-3.32-2.29-6.76-4.66-11.22-4.66-2.54 0-5.05 0.77-7.67 2.36-7.56 4.58-12.7 6.63-16.67 6.63-2.15 0-4.09-0.61-6.27-1.98-1.67-1.05-2.95-2.63-3.1-3.86-0.06-0.43-0.02-1.04 0.76-1.87 5.83-6.22 17.78-15.19 24.92-20.54 2.08-1.56 3.73-2.8 4.81-3.65 3.41-2.67 7.39-3.97 12.18-3.97m0-3c-5.5 0-10.16 1.57-14.03 4.62-4.84 3.83-22.37 16.31-30.06 24.5-3.67 3.92-0.25 8.33 2.94 10.32 2.47 1.55 4.94 2.44 7.86 2.44 4.47 0 10.01-2.08 18.22-7.06 2.27-1.38 4.27-1.93 6.12-1.93 3.79 0 6.89 2.33 10.2 4.6 0 0 7.71 6.39 14.5 8.78 1.38 0.48 3.12 0.72 5.08 0.72 1.84 0 3.86-0.21 5.93-0.61-12.97-11.05-20.03-27.57-15.69-44.58-4.01-1.21-7.69-1.8-11.07-1.8z" fill="#EDA600"/></g></g>
|
||||
</g>
|
||||
</defs>
|
||||
<use href="#cg0" transform="translate(0,0)"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.1 KiB |
@@ -13,3 +13,5 @@
|
||||
../../../api/fonts/AdobeVFPrototype.abc.otf;--variations=wght=900,CNTR=100;U+0061,U+0062,U+0063;../expected/basic/cff2-var-cntr.svg
|
||||
../../../api/fonts/SourceSerifVariable-Roman-VVAR.abc.ttf;--direction=ttb --variations=wght=900;U+0061,U+0062,U+0063;../expected/basic/glyf-vvar-ttb-wght900.svg
|
||||
../fonts/2db082c6c462d5056544e56e7ea13bf58c33a832.ttf;--logical;U+0646,U+0633,U+062A,U+0639,U+0644,U+06CC,U+0642;../expected/basic/iran-nastaliq-y-offsets.svg
|
||||
../../../fuzzing/fonts/noto_handwriting-untouchedsvg.ttf;;U+270D;../expected/basic/handwriting-svg.svg
|
||||
../../../fuzzing/fonts/noto_handwriting-untouchedsvgz.ttf;;U+270D;../expected/basic/handwriting-svg.svg
|
||||
Reference in new issue
Block a user