parent
0f2fe75508
commit
0d6f77e629
6 changed files with 110 additions and 0 deletions
@ -0,0 +1,66 @@ |
||||
#ifndef OT_VAR_VARC_VARC_HH |
||||
#define OT_VAR_VARC_VARC_HH |
||||
|
||||
#include "../../../hb-ot-layout-common.hh" |
||||
|
||||
namespace OT { |
||||
|
||||
//namespace Var {
|
||||
|
||||
/*
|
||||
* VARC -- Variable Composites |
||||
* https://github.com/harfbuzz/boring-expansion-spec/blob/main/VARC.md
|
||||
*/ |
||||
|
||||
struct VARC |
||||
{ |
||||
static constexpr hb_tag_t tableTag = HB_TAG ('V', 'A', 'R', 'C'); |
||||
|
||||
bool |
||||
get_path (hb_font_t *font, hb_codepoint_t gid, hb_draw_session_t &draw_session) const |
||||
{ |
||||
unsigned idx = (this+coverage).get_coverage (gid); |
||||
if (idx == NOT_COVERED) |
||||
return false; |
||||
|
||||
// TODO
|
||||
|
||||
return true; |
||||
} |
||||
|
||||
bool paint_glyph (hb_font_t *font, hb_codepoint_t gid, hb_paint_funcs_t *funcs, void *data, hb_color_t foreground) const |
||||
{ |
||||
funcs->push_clip_glyph (data, gid, font); |
||||
funcs->color (data, true, foreground); |
||||
funcs->pop_clip (data); |
||||
|
||||
return true; |
||||
} |
||||
|
||||
bool sanitize (hb_sanitize_context_t *c) const |
||||
{ |
||||
TRACE_SANITIZE (this); |
||||
return_trace (version.sanitize (c) && |
||||
hb_barrier () && |
||||
version.major == 1 && |
||||
coverage.sanitize (c, this) && |
||||
varStore.sanitize (c, this) && |
||||
axisIndicesList.sanitize (c, this) && |
||||
glyphRecords.sanitize (c, this)); |
||||
} |
||||
|
||||
protected: |
||||
FixedVersion<> version; /* Version identifier */ |
||||
Offset32To<Coverage> coverage; |
||||
Offset32To<MultiItemVariationStore> varStore; |
||||
Offset32To<CFF2Index/*Of<TupleValues>*/> axisIndicesList; |
||||
Offset32To<CFF2Index/*Of<VarCompositeGlyph>*/> glyphRecords; |
||||
public: |
||||
DEFINE_SIZE_STATIC (20); |
||||
}; |
||||
|
||||
//}
|
||||
|
||||
} |
||||
|
||||
#endif /* OT_VAR_VARC_VARC_HH */ |
@ -0,0 +1,32 @@ |
||||
/*
|
||||
* Copyright © 2024 Google, 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. |
||||
* |
||||
* Google Author(s): Behdad Esfahbod |
||||
*/ |
||||
|
||||
#ifndef HB_OT_VAR_VARC_TABLE_HH |
||||
#define HB_OT_VAR_VARC_TABLE_HH |
||||
|
||||
#include "OT/Var/VARC/VARC.hh" |
||||
|
||||
#endif /* HB_OT_VAR_VARC_TABLE_HH */ |
Loading…
Reference in new issue