[hmtx] Use more conventional internal API style
This commit is contained in:
parent
c9577a630f
commit
ee7610181c
|
@ -75,7 +75,6 @@ HB_BASE_sources = \
|
||||||
hb-ot-hdmx-table.hh \
|
hb-ot-hdmx-table.hh \
|
||||||
hb-ot-head-table.hh \
|
hb-ot-head-table.hh \
|
||||||
hb-ot-hhea-table.hh \
|
hb-ot-hhea-table.hh \
|
||||||
hb-ot-hmtx-table.cc \
|
|
||||||
hb-ot-hmtx-table.hh \
|
hb-ot-hmtx-table.hh \
|
||||||
hb-ot-kern-table.hh \
|
hb-ot-kern-table.hh \
|
||||||
hb-ot-layout-base-table.hh \
|
hb-ot-layout-base-table.hh \
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
#include "hb-ot-color.cc"
|
#include "hb-ot-color.cc"
|
||||||
#include "hb-ot-face.cc"
|
#include "hb-ot-face.cc"
|
||||||
#include "hb-ot-font.cc"
|
#include "hb-ot-font.cc"
|
||||||
#include "hb-ot-hmtx-table.cc"
|
|
||||||
#include "hb-ot-layout.cc"
|
#include "hb-ot-layout.cc"
|
||||||
#include "hb-ot-map.cc"
|
#include "hb-ot-map.cc"
|
||||||
#include "hb-ot-math.cc"
|
#include "hb-ot-math.cc"
|
||||||
|
|
|
@ -315,5 +315,17 @@ hb_ot_font_set_funcs (hb_font_t *font)
|
||||||
nullptr);
|
nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
hb_ot_get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool is_vertical)
|
||||||
|
{
|
||||||
|
return font->face->table.glyf->get_side_bearing_var (glyph, font->coords, font->num_coords, is_vertical);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned
|
||||||
|
hb_ot_get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool is_vertical)
|
||||||
|
{
|
||||||
|
return font->face->table.glyf->get_advance_var (glyph, font->coords, font->num_coords, is_vertical);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright © 2019 Adobe Inc.
|
|
||||||
*
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* Adobe Author(s): Michiharu Ariza
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "hb-ot-hmtx-table.hh"
|
|
||||||
#include "hb-ot-glyf-table.hh"
|
|
||||||
|
|
||||||
namespace OT {
|
|
||||||
|
|
||||||
int hmtxvmtx_accelerator_base_t::get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool is_vertical)
|
|
||||||
{
|
|
||||||
return font->face->table.glyf->get_side_bearing_var (glyph, font->coords, font->num_coords, is_vertical);
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int hmtxvmtx_accelerator_base_t::get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool is_vertical)
|
|
||||||
{
|
|
||||||
return font->face->table.glyf->get_advance_var (glyph, font->coords, font->num_coords, is_vertical);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -42,6 +42,13 @@
|
||||||
#define HB_OT_TAG_vmtx HB_TAG('v','m','t','x')
|
#define HB_OT_TAG_vmtx HB_TAG('v','m','t','x')
|
||||||
|
|
||||||
|
|
||||||
|
HB_INTERNAL int
|
||||||
|
hb_ot_get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool is_vertical);
|
||||||
|
|
||||||
|
HB_INTERNAL unsigned
|
||||||
|
hb_ot_get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool is_vertical);
|
||||||
|
|
||||||
|
|
||||||
namespace OT {
|
namespace OT {
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,11 +60,6 @@ struct LongMetric
|
||||||
DEFINE_SIZE_STATIC (4);
|
DEFINE_SIZE_STATIC (4);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct hmtxvmtx_accelerator_base_t
|
|
||||||
{
|
|
||||||
HB_INTERNAL static int get_side_bearing_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool is_vertical);
|
|
||||||
HB_INTERNAL static unsigned int get_advance_var_tt (hb_font_t *font, hb_codepoint_t glyph, bool is_vertical);
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T, typename H>
|
template <typename T, typename H>
|
||||||
struct hmtxvmtx
|
struct hmtxvmtx
|
||||||
|
@ -156,7 +158,7 @@ struct hmtxvmtx
|
||||||
return_trace (true);
|
return_trace (true);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct accelerator_t : hmtxvmtx_accelerator_base_t
|
struct accelerator_t
|
||||||
{
|
{
|
||||||
friend struct hmtxvmtx;
|
friend struct hmtxvmtx;
|
||||||
|
|
||||||
|
@ -213,7 +215,7 @@ struct hmtxvmtx
|
||||||
return side_bearing;
|
return side_bearing;
|
||||||
|
|
||||||
if (var_table.get_blob () == &Null (hb_blob_t))
|
if (var_table.get_blob () == &Null (hb_blob_t))
|
||||||
return get_side_bearing_var_tt (font, glyph, T::tableTag == HB_OT_TAG_vmtx);
|
return hb_ot_get_side_bearing_var_tt (font, glyph, T::tableTag == HB_OT_TAG_vmtx);
|
||||||
|
|
||||||
return side_bearing + var_table->get_side_bearing_var (glyph, font->coords, font->num_coords); // TODO Optimize?!
|
return side_bearing + var_table->get_side_bearing_var (glyph, font->coords, font->num_coords); // TODO Optimize?!
|
||||||
}
|
}
|
||||||
|
@ -243,7 +245,7 @@ struct hmtxvmtx
|
||||||
return advance;
|
return advance;
|
||||||
|
|
||||||
if (var_table.get_blob () == &Null (hb_blob_t))
|
if (var_table.get_blob () == &Null (hb_blob_t))
|
||||||
return get_advance_var_tt (font, glyph, T::tableTag == HB_OT_TAG_vmtx);
|
return hb_ot_get_advance_var_tt (font, glyph, T::tableTag == HB_OT_TAG_vmtx);
|
||||||
|
|
||||||
return advance + roundf (var_table->get_advance_var (glyph, font->coords, font->num_coords)); // TODO Optimize?!
|
return advance + roundf (var_table->get_advance_var (glyph, font->coords, font->num_coords)); // TODO Optimize?!
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue