Bug 1576041 - Update HarfBuzz to 2.6.1. r=jfkthame

Differential Revision: https://phabricator.services.mozilla.com/D43201

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ryan VanderMeulen 2019-08-23 14:12:12 +00:00
parent 10013b939f
commit 9b1cdd9e22
25 changed files with 456 additions and 484 deletions

View File

@ -1,3 +1,14 @@
Overview of changes leading to 2.6.1
Thursday, August 22, 2019
====================================
- Fix regression with hb_font_create_sub_font scaling introduced in 2.6.0.
- Change interpretation of font PTEM size / CoreText font size handling.
See https://github.com/harfbuzz/harfbuzz/pull/1484
- hb-ot-font: Prefer symbol cmap subtable if present.
- Apply 'dist'/'abvm'/'blwm' features to all scripts.
- Drop experimental DirectWrite API.
Overview of changes leading to 2.6.0
Tuesday, August 13, 2019
====================================

View File

@ -1,7 +1,7 @@
This directory contains the HarfBuzz source from the upstream repo:
https://github.com/harfbuzz/harfbuzz
Current version: 2.6.0 [commit 6461143b44f81a4190d3f1cb02238750536f08e4]
Current version: 2.6.1 [commit be97e9d678017d4ec66625fa2b17ef3485552cad]
UPDATING:

View File

@ -1,6 +1,7 @@
[![Travis Build Status](https://travis-ci.org/harfbuzz/harfbuzz.svg?branch=master)](https://travis-ci.org/harfbuzz/harfbuzz)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/0t0flrxpstj9lb9w?svg=true&branch=master)](https://ci.appveyor.com/project/harfbuzz/harfbuzz)
[![CircleCI Build Status](https://circleci.com/gh/harfbuzz/harfbuzz/tree/master.svg?style=svg)](https://circleci.com/gh/harfbuzz/harfbuzz/tree/master)
[![OSS-Fuzz Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/harfbuzz.svg)](https://oss-fuzz-build-logs.storage.googleapis.com/index.html)
[![Coverity Code Health](https://img.shields.io/coverity/scan/5450.svg)](https://scan.coverity.com/projects/behdad-harfbuzz)
[![Codacy Code Health](https://api.codacy.com/project/badge/Grade/f17f1708783c447488bc8dd317150eaa)](https://app.codacy.com/app/behdad/harfbuzz)
[![Codecov Code Coverage](https://codecov.io/gh/harfbuzz/harfbuzz/branch/master/graph/badge.svg)](https://codecov.io/gh/harfbuzz/harfbuzz)

View File

@ -1,6 +1,6 @@
AC_PREREQ([2.64])
AC_INIT([HarfBuzz],
[2.6.0],
[2.6.1],
[https://github.com/harfbuzz/harfbuzz/issues/new],
[harfbuzz],
[http://harfbuzz.org/])

View File

@ -1,99 +0,0 @@
#!/bin/bash
# Suggested setup to use the script:
# (on the root of the project)
# $ NOCONFIGURE=1 ./autogen.sh && mkdir build && cd build
# $ ../configure --with-freetype --with-glib --with-gobject --with-cairo
# $ make -j5 && cd ..
# $ src/dev-run.sh [FONT-FILE] [TEXT]
#
# Or, using cmake:
# $ cmake -DHB_CHECK=ON -Bbuild -H. -GNinja && ninja -Cbuild
# $ src/dev-run.sh [FONT-FILE] [TEXT]
#
# If you want to open the result rendering using a GUI app,
# $ src/dev-run.sh open [FONT-FILE] [TEXT]
#
# And if you are using iTerm2, you can use the script like this,
# $ src/dev-run.sh img [FONT-FILE] [TEXT]
#
[ $# = 0 ] && echo Usage: "src/dev-run.sh [FONT-FILE] [TEXT]" && exit
command -v entr >/dev/null 2>&1 || { echo >&2 "This script needs `entr` be installed"; exit 1; }
GDB=gdb
# if gdb doesn't exist, hopefully lldb exist
command -v $GDB >/dev/null 2>&1 || export GDB="lldb"
[ $1 = "open" ] && openimg=1 && shift
OPEN=xdg-open
[ "$(uname)" == "Darwin" ] && OPEN=open
[ $1 = "img" ] && img=1 && shift
# http://iterm2.com/documentation-images.html
osc="\033]"
if [[ $TERM == screen* ]]; then osc="\033Ptmux;\033\033]"; fi
st="\a"
if [[ $TERM == screen* ]]; then st="\a"; fi
tmp=tmp.png
[ -f 'build/build.ninja' ] && CMAKENINJA=TRUE
# or "fswatch -0 . -e build/ -e .git"
find src/ | entr printf '\0' | while read -d ""; do
clear
yes = | head -n`tput cols` | tr -d '\n'
if [[ $CMAKENINJA ]]; then
ninja -Cbuild hb-shape hb-view && {
build/hb-shape $@
if [ $openimg ]; then
build/hb-view $@ -O png -o $tmp
$OPEN $tmp
elif [ $img ]; then
build/hb-view $@ -O png -o $tmp
printf "\n${osc}1337;File=;inline=1:`cat $tmp | base64`${st}\n"
else
build/hb-view $@
fi
}
else
make -Cbuild/src -j5 -s lib && {
build/util/hb-shape $@
if [ $openimg ]; then
build/util/hb-view $@ -O png -o $tmp
$OPEN $tmp
elif [ $img ]; then
build/util/hb-view $@ -O png -o $tmp
printf "\n${osc}1337;File=;inline=1:`cat $tmp | base64`${st}\n"
else
build/util/hb-view $@
fi
}
fi
done
read -n 1 -p "[C]heck, [D]ebug, [R]estart, [Q]uit? " answer
case "$answer" in
c|C )
if [[ $CMAKENINJA ]]; then
CTEST_OUTPUT_ON_FAILURE=1 CTEST_PARALLEL_LEVEL=5 ninja -Cbuild test
else
make -Cbuild -j5 check && .ci/fail.sh
fi
;;
d|D )
if [[ $CMAKENINJA ]]; then
echo "Not supported on cmake builds yet"
else
build/libtool --mode=execute $GDB -- build/util/hb-shape $@
fi
;;
r|R )
src/dev-run.sh $@
;;
* )
exit
;;
esac

View File

@ -38,6 +38,80 @@ namespace AAT {
typedef ArrayOf<HBINT16> LigCaretClassEntry;
struct lcarFormat0
{
unsigned int get_lig_carets (hb_font_t *font,
hb_direction_t direction,
hb_codepoint_t glyph,
unsigned int start_offset,
unsigned int *caret_count /* IN/OUT */,
hb_position_t *caret_array /* OUT */,
const void *base) const
{
const OffsetTo<LigCaretClassEntry>* entry_offset = lookupTable.get_value (glyph,
font->face->get_num_glyphs ());
const LigCaretClassEntry& array = entry_offset ? base+*entry_offset : Null (LigCaretClassEntry);
if (caret_count)
{
hb_array_t<const HBINT16> arr = array.sub_array (start_offset, caret_count);
for (unsigned int i = 0; i < arr.length; ++i)
caret_array[i] = font->em_scale_dir (arr[i], direction);
}
return array.len;
}
bool sanitize (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);
return_trace (likely (c->check_struct (this) && lookupTable.sanitize (c, base)));
}
protected:
Lookup<OffsetTo<LigCaretClassEntry>>
lookupTable; /* data Lookup table associating glyphs */
public:
DEFINE_SIZE_MIN (2);
};
struct lcarFormat1
{
unsigned int get_lig_carets (hb_font_t *font,
hb_direction_t direction,
hb_codepoint_t glyph,
unsigned int start_offset,
unsigned int *caret_count /* IN/OUT */,
hb_position_t *caret_array /* OUT */,
const void *base) const
{
const OffsetTo<LigCaretClassEntry>* entry_offset = lookupTable.get_value (glyph,
font->face->get_num_glyphs ());
const LigCaretClassEntry& array = entry_offset ? base+*entry_offset : Null (LigCaretClassEntry);
if (caret_count)
{
hb_array_t<const HBINT16> arr = array.sub_array (start_offset, caret_count);
for (unsigned int i = 0; i < arr.length; ++i)
{
hb_position_t x = 0, y = 0;
font->get_glyph_contour_point_for_origin (glyph, arr[i], direction, &x, &y);
caret_array[i] = HB_DIRECTION_IS_HORIZONTAL (direction) ? x : y;
}
}
return array.len;
}
bool sanitize (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);
return_trace (likely (c->check_struct (this) && lookupTable.sanitize (c, base)));
}
protected:
Lookup<OffsetTo<LigCaretClassEntry>>
lookupTable; /* data Lookup table associating glyphs */
public:
DEFINE_SIZE_MIN (2);
};
struct lcar
{
static constexpr hb_tag_t tableTag = HB_AAT_TAG_lcar;
@ -49,45 +123,36 @@ struct lcar
unsigned int *caret_count /* IN/OUT */,
hb_position_t *caret_array /* OUT */) const
{
const OffsetTo<LigCaretClassEntry>* entry_offset = lookup.get_value (glyph,
font->face->get_num_glyphs ());
const LigCaretClassEntry& array = entry_offset ? this+*entry_offset : Null (LigCaretClassEntry);
if (caret_count)
switch (format)
{
hb_array_t<const HBINT16> arr = array.sub_array (start_offset, caret_count);
switch (format)
{
case 0:
for (unsigned int i = 0; i < arr.length; ++i)
caret_array[i] = font->em_scale_dir (arr[i], direction);
break;
case 1:
for (unsigned int i = 0; i < arr.length; ++i)
{
hb_position_t x, y;
font->get_glyph_contour_point_for_origin (glyph, arr[i], direction, &x, &y);
caret_array[i] = HB_DIRECTION_IS_HORIZONTAL (direction) ? x : y;
}
break;
}
case 0: return u.format0.get_lig_carets (font, direction, glyph, start_offset,
caret_count, caret_array, this);
case 1: return u.format1.get_lig_carets (font, direction, glyph, start_offset,
caret_count, caret_array, this);
default:if (caret_count) *caret_count = 0; return 0;
}
return array.len;
}
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (likely (c->check_struct (this) &&
version.major == 1 &&
lookup.sanitize (c, this)));
if (unlikely (!c->check_struct (this) || version.major != 1))
return_trace (false);
switch (format) {
case 0: return_trace (u.format0.sanitize (c, this));
case 1: return_trace (u.format1.sanitize (c, this));
default:return_trace (true);
}
}
protected:
FixedVersion<>version; /* Version number of the ligature caret table */
HBUINT16 format; /* Format of the ligature caret table. */
Lookup<OffsetTo<LigCaretClassEntry>>
lookup; /* data Lookup table associating glyphs */
union {
lcarFormat0 format0;
lcarFormat0 format1;
} u;
public:
DEFINE_SIZE_MIN (8);
};

View File

@ -45,50 +45,112 @@ struct OpticalBounds
return_trace (likely (c->check_struct (this)));
}
HBINT16 leftSide;
HBINT16 topSide;
HBINT16 rightSide;
HBINT16 bottomSide;
FWORD leftSide;
FWORD topSide;
FWORD rightSide;
FWORD bottomSide;
public:
DEFINE_SIZE_STATIC (8);
};
struct opbdFormat0
{
bool get_bounds (hb_font_t *font, hb_codepoint_t glyph_id,
hb_glyph_extents_t *extents, const void *base) const
{
const OffsetTo<OpticalBounds> *bounds_offset = lookupTable.get_value (glyph_id, font->face->get_num_glyphs ());
if (!bounds_offset) return false;
const OpticalBounds &bounds = base+*bounds_offset;
if (extents)
*extents = {
font->em_scale_x (bounds.leftSide),
font->em_scale_y (bounds.topSide),
font->em_scale_x (bounds.rightSide),
font->em_scale_y (bounds.bottomSide)
};
return true;
}
bool sanitize (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);
return_trace (likely (c->check_struct (this) && lookupTable.sanitize (c, base)));
}
protected:
Lookup<OffsetTo<OpticalBounds>>
lookupTable; /* Lookup table associating glyphs with the four
* int16 values for the left-side, top-side,
* right-side, and bottom-side optical bounds. */
public:
DEFINE_SIZE_MIN (2);
};
struct opbdFormat1
{
bool get_bounds (hb_font_t *font, hb_codepoint_t glyph_id,
hb_glyph_extents_t *extents, const void *base) const
{
const OffsetTo<OpticalBounds> *bounds_offset = lookupTable.get_value (glyph_id, font->face->get_num_glyphs ());
if (!bounds_offset) return false;
const OpticalBounds &bounds = base+*bounds_offset;
hb_position_t left = 0, top = 0, right = 0, bottom = 0, ignore;
if (font->get_glyph_contour_point (glyph_id, bounds.leftSide, &left, &ignore) ||
font->get_glyph_contour_point (glyph_id, bounds.topSide, &ignore, &top) ||
font->get_glyph_contour_point (glyph_id, bounds.rightSide, &right, &ignore) ||
font->get_glyph_contour_point (glyph_id, bounds.bottomSide, &ignore, &bottom))
{
if (extents)
*extents = {left, top, right, bottom};
return true;
}
return false;
}
bool sanitize (hb_sanitize_context_t *c, const void *base) const
{
TRACE_SANITIZE (this);
return_trace (likely (c->check_struct (this) && lookupTable.sanitize (c, base)));
}
protected:
Lookup<OffsetTo<OpticalBounds>>
lookupTable; /* Lookup table associating glyphs with the four
* int16 values for the left-side, top-side,
* right-side, and bottom-side optical bounds. */
public:
DEFINE_SIZE_MIN (2);
};
struct opbd
{
static constexpr hb_tag_t tableTag = HB_AAT_TAG_opbd;
bool get_optical_bounds (hb_font_t *font, hb_codepoint_t glyph_id,
hb_position_t *left, hb_position_t *top,
hb_position_t *right, hb_position_t *bottom) const
bool get_bounds (hb_font_t *font, hb_codepoint_t glyph_id,
hb_glyph_extents_t *extents) const
{
const OffsetTo<OpticalBounds> *bounds_offset = lookupTable.get_value (glyph_id, font->face->get_num_glyphs ());
if (!bounds_offset) return false;
const OpticalBounds &bounds = this+*bounds_offset;
switch (format)
{
case 0:
*left = font->em_scale_x (bounds.leftSide);
*top = font->em_scale_y (bounds.topSide);
*right = font->em_scale_x (bounds.rightSide);
*bottom = font->em_scale_y (bounds.bottomSide);
return true;
case 1:
hb_position_t ignore;
return font->get_glyph_contour_point (glyph_id, bounds.leftSide, left, &ignore) &&
font->get_glyph_contour_point (glyph_id, bounds.topSide, &ignore, top) &&
font->get_glyph_contour_point (glyph_id, bounds.rightSide, right, &ignore) &&
font->get_glyph_contour_point (glyph_id, bounds.bottomSide, &ignore, bottom);
default:
return false;
case 0: return u.format0.get_bounds (font, glyph_id, extents, this);
case 1: return u.format1.get_bounds (font, glyph_id, extents, this);
default:return false;
}
}
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (likely (c->check_struct (this) &&
version.major == 1 &&
lookupTable.sanitize (c, this)));
if (unlikely (!c->check_struct (this) || version.major != 1))
return_trace (false);
switch (format)
{
case 0: return_trace (u.format0.sanitize (c, this));
case 1: return_trace (u.format1.sanitize (c, this));
default:return_trace (true);
}
}
protected:
@ -97,10 +159,10 @@ struct opbd
HBUINT16 format; /* Format of the optical bounds table.
* Format 0 indicates distance and Format 1 indicates
* control point. */
Lookup<OffsetTo<OpticalBounds>>
lookupTable; /* Lookup table associating glyphs with the four
* int16 values for the left-side, top-side,
* right-side, and bottom-side optical bounds. */
union {
opbdFormat0 format0;
opbdFormat1 format1;
} u;
public:
DEFINE_SIZE_MIN (8);
};

View File

@ -93,13 +93,6 @@ struct TrackData
int get_tracking (const void *base, float ptem) const
{
/* CoreText points are CSS pixels (96 per inch),
* NOT typographic points (72 per inch).
*
* https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html
*/
float csspx = ptem * 96.f / 72.f;
/*
* Choose track.
*/
@ -130,10 +123,10 @@ struct TrackData
hb_array_t<const Fixed> size_table ((base+sizeTable).arrayZ, sizes);
unsigned int size_index;
for (size_index = 0; size_index < sizes - 1; size_index++)
if (size_table[size_index].to_float () >= csspx)
if (size_table[size_index].to_float () >= ptem)
break;
return roundf (interpolate_at (size_index ? size_index - 1 : 0, csspx,
return roundf (interpolate_at (size_index ? size_index - 1 : 0, ptem,
*trackTableEntry, base));
}

View File

@ -49,24 +49,6 @@
/* https://developer.apple.com/documentation/coretext/1508745-ctfontcreatewithgraphicsfont */
#define HB_CORETEXT_DEFAULT_FONT_SIZE 12.f
static CGFloat
coretext_font_size_from_ptem (float ptem)
{
/* CoreText points are CSS pixels (96 per inch),
* NOT typographic points (72 per inch).
*
* https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Explained/Explained.html
*/
ptem *= 96.f / 72.f;
return (CGFloat) (ptem <= 0.f ? HB_CORETEXT_DEFAULT_FONT_SIZE : ptem);
}
static float
coretext_font_size_to_ptem (CGFloat size)
{
size *= 72. / 96.;
return size <= 0 ? 0 : size;
}
static void
release_table_data (void *user_data)
{
@ -320,7 +302,8 @@ _hb_coretext_shaper_font_data_create (hb_font_t *font)
if (unlikely (!face_data)) return nullptr;
CGFontRef cg_font = (CGFontRef) (const void *) face->data.coretext;
CTFontRef ct_font = create_ct_font (cg_font, coretext_font_size_from_ptem (font->ptem));
CGFloat font_size = font->ptem <= 0.f ? HB_CORETEXT_DEFAULT_FONT_SIZE : font->ptem;
CTFontRef ct_font = create_ct_font (cg_font, font_size);
if (unlikely (!ct_font))
{
@ -344,7 +327,7 @@ retry:
const hb_coretext_font_data_t *data = font->data.coretext;
if (unlikely (!data)) return nullptr;
if (fabs (CTFontGetSize((CTFontRef) data) - coretext_font_size_from_ptem (font->ptem)) > .5)
if (fabs (CTFontGetSize ((CTFontRef) data) - font->ptem) > .5)
{
/* XXX-MT-bug
* Note that evaluating condition above can be dangerous if another thread
@ -384,7 +367,7 @@ hb_coretext_font_create (CTFontRef ct_font)
if (unlikely (hb_object_is_immutable (font)))
return font;
hb_font_set_ptem (font, coretext_font_size_to_ptem (CTFontGetSize(ct_font)));
hb_font_set_ptem (font, CTFontGetSize (ct_font));
/* Let there be dragons here... */
font->data.coretext.cmpexch (nullptr, (hb_coretext_font_data_t *) CFRetain (ct_font));

View File

@ -879,29 +879,12 @@ _hb_directwrite_shape (hb_shape_plan_t *shape_plan,
features, num_features, 0);
}
/**
* hb_directwrite_shape_experimental_width:
* Experimental API to test DirectWrite's justification algorithm.
*
* It inserts Kashida at wrong order so don't use the API ever.
*
* It doesn't work with cygwin/msys due to header bugs so one
* should use MSVC toolchain in order to use it for now.
*
* @font:
* @buffer:
* @features:
* @num_features:
* @width:
*
* Since: 1.4.2
**/
hb_bool_t
hb_directwrite_shape_experimental_width (hb_font_t *font,
hb_buffer_t *buffer,
const hb_feature_t *features,
unsigned int num_features,
float width)
HB_UNUSED static bool
_hb_directwrite_shape_experimental_width (hb_font_t *font,
hb_buffer_t *buffer,
const hb_feature_t *features,
unsigned int num_features,
float width)
{
static const char *shapers = "directwrite";
hb_shape_plan_t *shape_plan;

View File

@ -29,11 +29,6 @@
HB_BEGIN_DECLS
HB_EXTERN hb_bool_t
hb_directwrite_shape_experimental_width (hb_font_t *font, hb_buffer_t *buffer,
const hb_feature_t *features,
unsigned int num_features, float width);
HB_EXTERN hb_face_t *
hb_directwrite_face_create (IDWriteFontFace *font_face);

View File

@ -518,9 +518,9 @@ static const hb_font_funcs_t _hb_font_funcs_default = {
/**
* hb_font_funcs_create: (Xconstructor)
*
*
*
* Return value: (transfer full):
*
* Return value: (transfer full):
*
* Since: 0.9.2
**/
@ -540,9 +540,9 @@ hb_font_funcs_create ()
/**
* hb_font_funcs_get_empty:
*
*
*
* Return value: (transfer full):
*
* Return value: (transfer full):
*
* Since: 0.9.2
**/
@ -556,9 +556,9 @@ hb_font_funcs_get_empty ()
* hb_font_funcs_reference: (skip)
* @ffuncs: font functions.
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -572,7 +572,7 @@ hb_font_funcs_reference (hb_font_funcs_t *ffuncs)
* hb_font_funcs_destroy: (skip)
* @ffuncs: font functions.
*
*
*
*
* Since: 0.9.2
**/
@ -592,14 +592,14 @@ hb_font_funcs_destroy (hb_font_funcs_t *ffuncs)
/**
* hb_font_funcs_set_user_data: (skip)
* @ffuncs: font functions.
* @key:
* @data:
* @destroy:
* @replace:
* @key:
* @data:
* @destroy:
* @replace:
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -616,11 +616,11 @@ hb_font_funcs_set_user_data (hb_font_funcs_t *ffuncs,
/**
* hb_font_funcs_get_user_data: (skip)
* @ffuncs: font functions.
* @key:
* @key:
*
*
*
* Return value: (transfer none):
*
* Return value: (transfer none):
*
* Since: 0.9.2
**/
@ -636,7 +636,7 @@ hb_font_funcs_get_user_data (hb_font_funcs_t *ffuncs,
* hb_font_funcs_make_immutable:
* @ffuncs: font functions.
*
*
*
*
* Since: 0.9.2
**/
@ -653,9 +653,9 @@ hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs)
* hb_font_funcs_is_immutable:
* @ffuncs: font functions.
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -751,13 +751,13 @@ hb_font_get_v_extents (hb_font_t *font,
/**
* hb_font_get_glyph:
* @font: a font.
* @unicode:
* @variation_selector:
* @glyph: (out):
* @unicode:
* @variation_selector:
* @glyph: (out):
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -774,12 +774,12 @@ hb_font_get_glyph (hb_font_t *font,
/**
* hb_font_get_nominal_glyph:
* @font: a font.
* @unicode:
* @glyph: (out):
* @unicode:
* @glyph: (out):
*
*
*
* Return value:
*
* Return value:
*
* Since: 1.2.3
**/
@ -794,13 +794,13 @@ hb_font_get_nominal_glyph (hb_font_t *font,
/**
* hb_font_get_variation_glyph:
* @font: a font.
* @unicode:
* @variation_selector:
* @glyph: (out):
* @unicode:
* @variation_selector:
* @glyph: (out):
*
*
*
* Return value:
*
* Return value:
*
* Since: 1.2.3
**/
@ -815,11 +815,11 @@ hb_font_get_variation_glyph (hb_font_t *font,
/**
* hb_font_get_glyph_h_advance:
* @font: a font.
* @glyph:
* @glyph:
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -833,11 +833,11 @@ hb_font_get_glyph_h_advance (hb_font_t *font,
/**
* hb_font_get_glyph_v_advance:
* @font: a font.
* @glyph:
* @glyph:
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -852,7 +852,7 @@ hb_font_get_glyph_v_advance (hb_font_t *font,
* hb_font_get_glyph_h_advances:
* @font: a font.
*
*
*
*
* Since: 1.8.6
**/
@ -870,7 +870,7 @@ hb_font_get_glyph_h_advances (hb_font_t* font,
* hb_font_get_glyph_v_advances:
* @font: a font.
*
*
*
*
* Since: 1.8.6
**/
@ -888,13 +888,13 @@ hb_font_get_glyph_v_advances (hb_font_t* font,
/**
* hb_font_get_glyph_h_origin:
* @font: a font.
* @glyph:
* @x: (out):
* @y: (out):
* @glyph:
* @x: (out):
* @y: (out):
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -909,13 +909,13 @@ hb_font_get_glyph_h_origin (hb_font_t *font,
/**
* hb_font_get_glyph_v_origin:
* @font: a font.
* @glyph:
* @x: (out):
* @y: (out):
* @glyph:
* @x: (out):
* @y: (out):
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -930,12 +930,12 @@ hb_font_get_glyph_v_origin (hb_font_t *font,
/**
* hb_font_get_glyph_h_kerning:
* @font: a font.
* @left_glyph:
* @right_glyph:
* @left_glyph:
* @right_glyph:
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -950,12 +950,12 @@ hb_font_get_glyph_h_kerning (hb_font_t *font,
/**
* hb_font_get_glyph_v_kerning:
* @font: a font.
* @top_glyph:
* @bottom_glyph:
* @top_glyph:
* @bottom_glyph:
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
* Deprecated: 2.0.0
@ -971,12 +971,12 @@ hb_font_get_glyph_v_kerning (hb_font_t *font,
/**
* hb_font_get_glyph_extents:
* @font: a font.
* @glyph:
* @extents: (out):
* @glyph:
* @extents: (out):
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -991,14 +991,14 @@ hb_font_get_glyph_extents (hb_font_t *font,
/**
* hb_font_get_glyph_contour_point:
* @font: a font.
* @glyph:
* @point_index:
* @x: (out):
* @y: (out):
* @glyph:
* @point_index:
* @x: (out):
* @y: (out):
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -1013,13 +1013,13 @@ hb_font_get_glyph_contour_point (hb_font_t *font,
/**
* hb_font_get_glyph_name:
* @font: a font.
* @glyph:
* @name: (array length=size):
* @size:
* @glyph:
* @name: (array length=size):
* @size:
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -1034,13 +1034,13 @@ hb_font_get_glyph_name (hb_font_t *font,
/**
* hb_font_get_glyph_from_name:
* @font: a font.
* @name: (array length=len):
* @len:
* @glyph: (out):
* @name: (array length=len):
* @len:
* @glyph: (out):
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -1075,12 +1075,12 @@ hb_font_get_extents_for_direction (hb_font_t *font,
/**
* hb_font_get_glyph_advance_for_direction:
* @font: a font.
* @glyph:
* @direction:
* @x: (out):
* @y: (out):
* @glyph:
* @direction:
* @x: (out):
* @y: (out):
*
*
*
*
* Since: 0.9.2
**/
@ -1095,9 +1095,9 @@ hb_font_get_glyph_advance_for_direction (hb_font_t *font,
/**
* hb_font_get_glyph_advances_for_direction:
* @font: a font.
* @direction:
* @direction:
*
*
*
*
* Since: 1.8.6
**/
@ -1116,12 +1116,12 @@ hb_font_get_glyph_advances_for_direction (hb_font_t* font,
/**
* hb_font_get_glyph_origin_for_direction:
* @font: a font.
* @glyph:
* @direction:
* @x: (out):
* @y: (out):
* @glyph:
* @direction:
* @x: (out):
* @y: (out):
*
*
*
*
* Since: 0.9.2
**/
@ -1137,12 +1137,12 @@ hb_font_get_glyph_origin_for_direction (hb_font_t *font,
/**
* hb_font_add_glyph_origin_for_direction:
* @font: a font.
* @glyph:
* @direction:
* @x: (out):
* @y: (out):
* @glyph:
* @direction:
* @x: (out):
* @y: (out):
*
*
*
*
* Since: 0.9.2
**/
@ -1158,12 +1158,12 @@ hb_font_add_glyph_origin_for_direction (hb_font_t *font,
/**
* hb_font_subtract_glyph_origin_for_direction:
* @font: a font.
* @glyph:
* @direction:
* @x: (out):
* @y: (out):
* @glyph:
* @direction:
* @x: (out):
* @y: (out):
*
*
*
*
* Since: 0.9.2
**/
@ -1179,13 +1179,13 @@ hb_font_subtract_glyph_origin_for_direction (hb_font_t *font,
/**
* hb_font_get_glyph_kerning_for_direction:
* @font: a font.
* @first_glyph:
* @second_glyph:
* @direction:
* @x: (out):
* @y: (out):
* @first_glyph:
* @second_glyph:
* @direction:
* @x: (out):
* @y: (out):
*
*
*
*
* Since: 0.9.2
**/
@ -1201,13 +1201,13 @@ hb_font_get_glyph_kerning_for_direction (hb_font_t *font,
/**
* hb_font_get_glyph_extents_for_origin:
* @font: a font.
* @glyph:
* @direction:
* @extents: (out):
* @glyph:
* @direction:
* @extents: (out):
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -1223,15 +1223,15 @@ hb_font_get_glyph_extents_for_origin (hb_font_t *font,
/**
* hb_font_get_glyph_contour_point_for_origin:
* @font: a font.
* @glyph:
* @point_index:
* @direction:
* @x: (out):
* @y: (out):
* @glyph:
* @point_index:
* @direction:
* @x: (out):
* @y: (out):
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -1248,11 +1248,11 @@ hb_font_get_glyph_contour_point_for_origin (hb_font_t *font,
/**
* hb_font_glyph_to_string:
* @font: a font.
* @glyph:
* @s: (array length=size):
* @size:
* @glyph:
* @s: (array length=size):
* @size:
*
*
*
*
* Since: 0.9.2
**/
@ -1268,13 +1268,13 @@ hb_font_glyph_to_string (hb_font_t *font,
/**
* hb_font_glyph_from_string:
* @font: a font.
* @s: (array length=len) (element-type uint8_t):
* @len:
* @glyph: (out):
* @s: (array length=len) (element-type uint8_t):
* @len:
* @glyph: (out):
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -1341,9 +1341,9 @@ _hb_font_create (hb_face_t *face)
* hb_font_create: (Xconstructor)
* @face: a face.
*
*
*
* Return value: (transfer full):
*
* Return value: (transfer full):
*
* Since: 0.9.2
**/
@ -1364,9 +1364,9 @@ hb_font_create (hb_face_t *face)
* hb_font_create_sub_font:
* @parent: parent font.
*
*
*
* Return value: (transfer full):
*
* Return value: (transfer full):
*
* Since: 0.9.2
**/
@ -1385,14 +1385,13 @@ hb_font_create_sub_font (hb_font_t *parent)
font->x_scale = parent->x_scale;
font->y_scale = parent->y_scale;
font->mults_changed ();
font->x_ppem = parent->x_ppem;
font->y_ppem = parent->y_ppem;
font->ptem = parent->ptem;
font->num_coords = parent->num_coords;
if (!font->num_coords)
font->coords = nullptr;
else
if (font->num_coords)
{
unsigned int size = parent->num_coords * sizeof (parent->coords[0]);
font->coords = (int *) malloc (size);
@ -1408,7 +1407,7 @@ hb_font_create_sub_font (hb_font_t *parent)
/**
* hb_font_get_empty:
*
*
*
*
* Return value: (transfer full)
*
@ -1424,9 +1423,9 @@ hb_font_get_empty ()
* hb_font_reference: (skip)
* @font: a font.
*
*
*
* Return value: (transfer full):
*
* Return value: (transfer full):
*
* Since: 0.9.2
**/
@ -1440,7 +1439,7 @@ hb_font_reference (hb_font_t *font)
* hb_font_destroy: (skip)
* @font: a font.
*
*
*
*
* Since: 0.9.2
**/
@ -1466,14 +1465,14 @@ hb_font_destroy (hb_font_t *font)
/**
* hb_font_set_user_data: (skip)
* @font: a font.
* @key:
* @data:
* @destroy:
* @replace:
* @key:
* @data:
* @destroy:
* @replace:
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -1490,11 +1489,11 @@ hb_font_set_user_data (hb_font_t *font,
/**
* hb_font_get_user_data: (skip)
* @font: a font.
* @key:
* @key:
*
*
*
* Return value: (transfer none):
*
* Return value: (transfer none):
*
* Since: 0.9.2
**/
@ -1509,7 +1508,7 @@ hb_font_get_user_data (hb_font_t *font,
* hb_font_make_immutable:
* @font: a font.
*
*
*
*
* Since: 0.9.2
**/
@ -1529,9 +1528,9 @@ hb_font_make_immutable (hb_font_t *font)
* hb_font_is_immutable:
* @font: a font.
*
*
*
* Return value:
*
* Return value:
*
* Since: 0.9.2
**/
@ -1571,9 +1570,9 @@ hb_font_set_parent (hb_font_t *font,
* hb_font_get_parent:
* @font: a font.
*
*
*
* Return value: (transfer none):
*
* Return value: (transfer none):
*
* Since: 0.9.2
**/
@ -1615,9 +1614,9 @@ hb_font_set_face (hb_font_t *font,
* hb_font_get_face:
* @font: a font.
*
*
*
* Return value: (transfer none):
*
* Return value: (transfer none):
*
* Since: 0.9.2
**/
@ -1632,10 +1631,10 @@ hb_font_get_face (hb_font_t *font)
* hb_font_set_funcs:
* @font: a font.
* @klass: (closure font_data) (destroy destroy) (scope notified):
* @font_data:
* @destroy:
* @font_data:
* @destroy:
*
*
*
*
* Since: 0.9.2
**/
@ -1669,9 +1668,9 @@ hb_font_set_funcs (hb_font_t *font,
* hb_font_set_funcs_data:
* @font: a font.
* @font_data: (destroy destroy) (scope notified):
* @destroy:
* @destroy:
*
*
*
*
* Since: 0.9.2
**/
@ -1699,10 +1698,10 @@ hb_font_set_funcs_data (hb_font_t *font,
/**
* hb_font_set_scale:
* @font: a font.
* @x_scale:
* @y_scale:
* @x_scale:
* @y_scale:
*
*
*
*
* Since: 0.9.2
**/
@ -1722,10 +1721,10 @@ hb_font_set_scale (hb_font_t *font,
/**
* hb_font_get_scale:
* @font: a font.
* @x_scale: (out):
* @y_scale: (out):
* @x_scale: (out):
* @y_scale: (out):
*
*
*
*
* Since: 0.9.2
**/
@ -1741,10 +1740,10 @@ hb_font_get_scale (hb_font_t *font,
/**
* hb_font_set_ppem:
* @font: a font.
* @x_ppem:
* @y_ppem:
* @x_ppem:
* @y_ppem:
*
*
*
*
* Since: 0.9.2
**/
@ -1763,10 +1762,10 @@ hb_font_set_ppem (hb_font_t *font,
/**
* hb_font_get_ppem:
* @font: a font.
* @x_ppem: (out):
* @y_ppem: (out):
* @x_ppem: (out):
* @y_ppem: (out):
*
*
*
*
* Since: 0.9.2
**/
@ -1815,6 +1814,7 @@ hb_font_get_ptem (hb_font_t *font)
return font->ptem;
}
#ifndef HB_NO_VAR
/*
* Variations
*/
@ -1830,7 +1830,6 @@ _hb_font_adopt_var_coords_normalized (hb_font_t *font,
font->num_coords = coords_length;
}
#ifndef HB_NO_VAR
/**
* hb_font_set_variations:
*
@ -1909,7 +1908,6 @@ hb_font_set_var_named_instance (hb_font_t *font,
hb_font_set_var_coords_design (font, coords, coords_length);
free (coords);
}
#endif
/**
* hb_font_set_var_coords_normalized:
@ -1951,7 +1949,7 @@ hb_font_get_var_coords_normalized (hb_font_t *font,
return font->coords;
}
#endif
#ifndef HB_DISABLE_DEPRECATED
/*

View File

@ -224,7 +224,7 @@ hb_font_funcs_set_font_v_extents_func (hb_font_funcs_t *ffuncs,
* @user_data:
* @destroy:
*
*
*
*
* Since: 1.2.3
**/
@ -256,7 +256,7 @@ hb_font_funcs_set_nominal_glyphs_func (hb_font_funcs_t *ffuncs,
* @user_data:
* @destroy:
*
*
*
*
* Since: 1.2.3
**/
@ -272,7 +272,7 @@ hb_font_funcs_set_variation_glyph_func (hb_font_funcs_t *ffuncs,
* @user_data:
* @destroy:
*
*
*
*
* Since: 0.9.2
**/
@ -288,7 +288,7 @@ hb_font_funcs_set_glyph_h_advance_func (hb_font_funcs_t *ffuncs,
* @user_data:
* @destroy:
*
*
*
*
* Since: 0.9.2
**/
@ -304,7 +304,7 @@ hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs,
* @user_data:
* @destroy:
*
*
*
*
* Since: 1.8.6
**/
@ -320,7 +320,7 @@ hb_font_funcs_set_glyph_h_advances_func (hb_font_funcs_t *ffuncs,
* @user_data:
* @destroy:
*
*
*
*
* Since: 1.8.6
**/
@ -336,7 +336,7 @@ hb_font_funcs_set_glyph_v_advances_func (hb_font_funcs_t *ffuncs,
* @user_data:
* @destroy:
*
*
*
*
* Since: 0.9.2
**/
@ -352,7 +352,7 @@ hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs,
* @user_data:
* @destroy:
*
*
*
*
* Since: 0.9.2
**/
@ -368,7 +368,7 @@ hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs,
* @user_data:
* @destroy:
*
*
*
*
* Since: 0.9.2
**/
@ -384,7 +384,7 @@ hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs,
* @user_data:
* @destroy:
*
*
*
*
* Since: 0.9.2
**/
@ -400,7 +400,7 @@ hb_font_funcs_set_glyph_extents_func (hb_font_funcs_t *ffuncs,
* @user_data:
* @destroy:
*
*
*
*
* Since: 0.9.2
**/
@ -416,7 +416,7 @@ hb_font_funcs_set_glyph_contour_point_func (hb_font_funcs_t *ffuncs,
* @user_data:
* @destroy:
*
*
*
*
* Since: 0.9.2
**/
@ -432,7 +432,7 @@ hb_font_funcs_set_glyph_name_func (hb_font_funcs_t *ffuncs,
* @user_data:
* @destroy:
*
*
*
*
* Since: 0.9.2
**/

View File

@ -110,12 +110,10 @@ bool OT::cff2::accelerator_t::get_extents (hb_font_t *font,
if (unlikely (!is_valid () || (glyph >= num_glyphs))) return false;
unsigned int num_coords;
const int *coords = hb_font_get_var_coords_normalized (font, &num_coords);
unsigned int fd = fdSelect->get_fd (glyph);
cff2_cs_interpreter_t<cff2_cs_opset_extents_t, cff2_extents_param_t> interp;
const byte_str_t str = (*charStrings)[glyph];
interp.env.init (str, *this, fd, coords, num_coords);
interp.env.init (str, *this, fd, font->coords, font->num_coords);
cff2_extents_param_t param;
param.init ();
if (unlikely (!interp.interpret (param))) return false;

View File

@ -993,6 +993,15 @@ struct cmap
const CmapSubtable *subtable;
/* Symbol subtable.
* Prefer symbol if available.
* https://github.com/harfbuzz/harfbuzz/issues/1918 */
if ((subtable = this->find_subtable (3, 0)))
{
if (symbol) *symbol = true;
return subtable;
}
/* 32-bit subtables. */
if ((subtable = this->find_subtable (3, 10))) return subtable;
if ((subtable = this->find_subtable (0, 6))) return subtable;
@ -1005,13 +1014,6 @@ struct cmap
if ((subtable = this->find_subtable (0, 1))) return subtable;
if ((subtable = this->find_subtable (0, 0))) return subtable;
/* Symbol subtable. */
if ((subtable = this->find_subtable (3, 0)))
{
if (symbol) *symbol = true;
return subtable;
}
/* Meh. */
return &Null (CmapSubtable);
}

View File

@ -375,10 +375,14 @@ hb_ot_layout_get_ligature_carets (hb_font_t *font,
{
if (caret_count) *caret_count = result_caret_count;
}
#ifndef HB_NO_AAT
else
{
#ifndef HB_NO_AAT
result = font->face->table.lcar->get_lig_carets (font, direction, glyph, start_offset, caret_count, caret_array);
#else
if (caret_count) *caret_count = 0;
#endif
}
return result;
}
#endif

View File

@ -131,13 +131,6 @@ indic_features[] =
{HB_TAG('b','l','w','s'), F_GLOBAL_MANUAL_JOINERS},
{HB_TAG('p','s','t','s'), F_GLOBAL_MANUAL_JOINERS},
{HB_TAG('h','a','l','n'), F_GLOBAL_MANUAL_JOINERS},
/*
* Positioning features.
* We don't care about the types.
*/
{HB_TAG('d','i','s','t'), F_GLOBAL},
{HB_TAG('a','b','v','m'), F_GLOBAL},
{HB_TAG('b','l','w','m'), F_GLOBAL},
};
/*
@ -163,10 +156,6 @@ enum {
_INDIC_PSTS,
_INDIC_HALN,
_INDIC_DIST,
_INDIC_ABVM,
_INDIC_BLWM,
INDIC_NUM_FEATURES,
INDIC_BASIC_FEATURES = INDIC_INIT, /* Don't forget to update this! */
};

View File

@ -56,13 +56,6 @@ khmer_features[] =
{HB_TAG('a','b','v','s'), F_GLOBAL_MANUAL_JOINERS},
{HB_TAG('b','l','w','s'), F_GLOBAL_MANUAL_JOINERS},
{HB_TAG('p','s','t','s'), F_GLOBAL_MANUAL_JOINERS},
/*
* Positioning features.
* We don't care about the types.
*/
{HB_TAG('d','i','s','t'), F_GLOBAL},
{HB_TAG('a','b','v','m'), F_GLOBAL},
{HB_TAG('b','l','w','m'), F_GLOBAL},
};
/*
@ -80,10 +73,6 @@ enum {
_KHMER_BLWS,
_KHMER_PSTS,
_KHMER_DIST,
_KHMER_ABVM,
_KHMER_BLWM,
KHMER_NUM_FEATURES,
KHMER_BASIC_FEATURES = _KHMER_PRES, /* Don't forget to update this! */
};

View File

@ -59,25 +59,6 @@ myanmar_other_features[] =
HB_TAG('b','l','w','s'),
HB_TAG('p','s','t','s'),
};
static const hb_tag_t
myanmar_positioning_features[] =
{
/*
* Positioning features.
* We don't care about the types.
*/
HB_TAG('d','i','s','t'),
/* Pre-release version of Windows 8 Myanmar font had abvm,blwm
* features. The released Windows 8 version of the font (as well
* as the released spec) used 'mark' instead. The Windows 8
* shaper however didn't apply 'mark' but did apply 'mkmk'.
* Perhaps it applied abvm/blwm. This was fixed in a Windows 8
* update, so now it applies mark/mkmk. We are guessing that
* it still applies abvm/blwm too.
*/
HB_TAG('a','b','v','m'),
HB_TAG('b','l','w','m'),
};
static void
setup_syllables_myanmar (const hb_ot_shape_plan_t *plan,
@ -114,9 +95,6 @@ collect_features_myanmar (hb_ot_shape_planner_t *plan)
for (unsigned int i = 0; i < ARRAY_LENGTH (myanmar_other_features); i++)
map->enable_feature (myanmar_other_features[i], F_MANUAL_ZWJ);
for (unsigned int i = 0; i < ARRAY_LENGTH (myanmar_positioning_features); i++)
map->enable_feature (myanmar_positioning_features[i]);
}
static void

View File

@ -88,17 +88,6 @@ use_other_features[] =
HB_TAG('p','r','e','s'),
HB_TAG('p','s','t','s'),
};
static const hb_tag_t
use_positioning_features[] =
{
/*
* Positioning features.
* We don't care about the types.
*/
HB_TAG('d','i','s','t'),
HB_TAG('a','b','v','m'),
HB_TAG('b','l','w','m'),
};
static void
setup_syllables_use (const hb_ot_shape_plan_t *plan,
@ -154,10 +143,6 @@ collect_features_use (hb_ot_shape_planner_t *plan)
/* "Standard typographic presentation" */
for (unsigned int i = 0; i < ARRAY_LENGTH (use_other_features); i++)
map->enable_feature (use_other_features[i], F_MANUAL_ZWJ);
/* "Positional feature application" */
for (unsigned int i = 0; i < ARRAY_LENGTH (use_positioning_features); i++)
map->enable_feature (use_positioning_features[i]);
}
struct use_shape_plan_t

View File

@ -285,6 +285,8 @@ hb_ot_shape_plan_t::position (hb_font_t *font,
static const hb_ot_map_feature_t
common_features[] =
{
{HB_TAG('a','b','v','m'), F_GLOBAL},
{HB_TAG('b','l','w','m'), F_GLOBAL},
{HB_TAG('c','c','m','p'), F_GLOBAL},
{HB_TAG('l','o','c','l'), F_GLOBAL},
{HB_TAG('m','a','r','k'), F_GLOBAL_MANUAL_JOINERS},
@ -299,6 +301,7 @@ horizontal_features[] =
{HB_TAG('c','a','l','t'), F_GLOBAL},
{HB_TAG('c','l','i','g'), F_GLOBAL},
{HB_TAG('c','u','r','s'), F_GLOBAL},
{HB_TAG('d','i','s','t'), F_GLOBAL},
{HB_TAG('k','e','r','n'), F_GLOBAL_HAS_FALLBACK},
{HB_TAG('l','i','g','a'), F_GLOBAL},
{HB_TAG('r','c','l','t'), F_GLOBAL},

View File

@ -49,9 +49,10 @@ struct AxisValueMap
}
public:
F2DOT14 fromCoord; /* A normalized coordinate value obtained using
* default normalization. */
F2DOT14 toCoord; /* The modified, normalized coordinate value. */
F2DOT14 coords[2];
// F2DOT14 fromCoord; /* A normalized coordinate value obtained using
// * default normalization. */
// F2DOT14 toCoord; /* The modified, normalized coordinate value. */
public:
DEFINE_SIZE_STATIC (4);
@ -59,12 +60,13 @@ struct AxisValueMap
struct SegmentMaps : ArrayOf<AxisValueMap>
{
int map (int value) const
int map (int value, unsigned int from_offset = 0, unsigned int to_offset = 1) const
{
#define fromCoord coords[from_offset]
#define toCoord coords[to_offset]
/* The following special-cases are not part of OpenType, which requires
* that at least -1, 0, and +1 must be mapped. But we include these as
* part of a better error recovery scheme. */
if (len < 2)
{
if (!len)
@ -91,8 +93,12 @@ struct SegmentMaps : ArrayOf<AxisValueMap>
return arrayZ[i-1].toCoord +
((arrayZ[i].toCoord - arrayZ[i-1].toCoord) *
(value - arrayZ[i-1].fromCoord) + denom/2) / denom;
#undef toCoord
#undef fromCoord
}
int unmap (int value) const { return map (value, 1, 0); }
public:
DEFINE_SIZE_ARRAY (2, *this);
};
@ -133,6 +139,18 @@ struct avar
}
}
void unmap_coords (int *coords, unsigned int coords_length) const
{
unsigned int count = hb_min (coords_length, axisCount);
const SegmentMaps *map = &firstAxisSegmentMaps;
for (unsigned int i = 0; i < count; i++)
{
coords[i] = map->unmap (coords[i]);
map = &StructAfter<SegmentMaps> (*map);
}
}
protected:
FixedVersion<>version; /* Version of the avar table
* initially set to 0x00010000u */
@ -140,7 +158,7 @@ struct avar
HBUINT16 axisCount; /* The number of variation axes in the font. This
* must be the same number as axisCount in the
* 'fvar' table. */
SegmentMaps firstAxisSegmentMaps;
SegmentMaps firstAxisSegmentMaps;
public:
DEFINE_SIZE_MIN (8);

View File

@ -240,6 +240,20 @@ struct fvar
return roundf (v * 16384.f);
}
float unnormalize_axis_value (unsigned int axis_index, float v) const
{
hb_ot_var_axis_info_t axis;
get_axis_info (axis_index, &axis);
if (v == 0)
return axis.default_value;
else if (v < 0)
v = v * (axis.default_value - axis.min_value) / 16384.f + axis.default_value;
else
v = v * (axis.max_value - axis.default_value) / 16384.f + axis.default_value;
return v;
}
unsigned int get_instance_count () const { return instanceCount; }
hb_ot_name_id_t get_instance_subfamily_name_id (unsigned int instance_index) const

View File

@ -38,9 +38,9 @@ HB_BEGIN_DECLS
#define HB_VERSION_MAJOR 2
#define HB_VERSION_MINOR 6
#define HB_VERSION_MICRO 0
#define HB_VERSION_MICRO 1
#define HB_VERSION_STRING "2.6.0"
#define HB_VERSION_STRING "2.6.1"
#define HB_VERSION_ATLEAST(major,minor,micro) \
((major)*10000+(minor)*100+(micro) <= \

View File

@ -5,7 +5,7 @@
MY_TEMP_DIR=`mktemp -d -t harfbuzz_update.XXXXXX` || exit 1
VERSION=2.6.0
VERSION=2.6.1
git clone https://github.com/harfbuzz/harfbuzz ${MY_TEMP_DIR}/harfbuzz
git -C ${MY_TEMP_DIR}/harfbuzz checkout ${VERSION}