QtBase  v6.3.1
hb-ot-color-colrv1-closure.hh
Go to the documentation of this file.
1 /*
2  * Copyright © 2018 Ebrahim Byagowi
3  * Copyright © 2020 Google, Inc.
4  *
5  * This is part of HarfBuzz, a text shaping library.
6  *
7  * Permission is hereby granted, without written agreement and without
8  * license or royalty fees, to use, copy, modify, and distribute this
9  * software and its documentation for any purpose, provided that the
10  * above copyright notice and the following two paragraphs appear in
11  * all copies of this software.
12  *
13  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
14  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
15  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
16  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
17  * DAMAGE.
18  *
19  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
20  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21  * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
22  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
23  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
24  *
25  */
26 
27 #ifndef HB_OT_COLR_COLRV1_CLOSURE_HH
28 #define HB_OT_COLR_COLRV1_CLOSURE_HH
29 
30 #include "hb-open-type.hh"
31 #include "hb-ot-layout-common.hh"
33 
34 /*
35  * COLR -- Color
36  * https://docs.microsoft.com/en-us/typography/opentype/spec/colr
37  */
38 namespace OT {
39 
41 {
42  c->add_layer_indices (firstLayerIndex, numLayers);
43  const LayerList &paint_offset_lists = c->get_colr_table ()->get_layerList ();
44  for (unsigned i = firstLayerIndex; i < firstLayerIndex + numLayers; i++)
45  {
46  const Paint &paint = std::addressof (paint_offset_lists) + paint_offset_lists[i];
47  paint.dispatch (c);
48  }
49 }
50 
52 {
53  c->add_glyph (gid);
54  (this+paint).dispatch (c);
55 }
56 
58 {
59  const COLR *colr_table = c->get_colr_table ();
60  const BaseGlyphPaintRecord* baseglyph_paintrecord = colr_table->get_base_glyph_paintrecord (gid);
61  if (!baseglyph_paintrecord) return;
62  c->add_glyph (gid);
63 
64  const BaseGlyphList &baseglyph_list = colr_table->get_baseglyphList ();
65  (&baseglyph_list+baseglyph_paintrecord->paint).dispatch (c);
66 }
67 
68 template <template<typename> class Var>
70 { (this+src).dispatch (c); }
71 
73 { (this+src).dispatch (c); }
74 
76 { (this+src).dispatch (c); }
77 
79 { (this+src).dispatch (c); }
80 
82 { (this+src).dispatch (c); }
83 
85 { (this+src).dispatch (c); }
86 
88 { (this+src).dispatch (c); }
89 
91 { (this+src).dispatch (c); }
92 
94 { (this+src).dispatch (c); }
95 
97 { (this+src).dispatch (c); }
98 
100 {
101  (this+src).dispatch (c);
102  (this+backdrop).dispatch (c);
103 }
104 
105 } /* namespace OT */
106 
107 
108 #endif /* HB_OT_COLR_COLRV1_CLOSURE_HH */
small capitals from c petite p scientific i
[1]
Definition: afcover.h:80
QPainter paint
#define HB_INTERNAL
Definition: hb.hh:274
GLuint numLayers
GLenum src
const GLubyte * c
Definition: qopenglext.h:12701
const BaseGlyphPaintRecord * get_base_glyph_paintrecord(hb_codepoint_t gid) const
const BaseGlyphList & get_baseglyphList() const
void closurev1(hb_colrv1_closure_context_t *c) const
void closurev1(hb_colrv1_closure_context_t *c) const
Offset24To< Paint > backdrop
Offset24To< Paint > src
void closurev1(hb_colrv1_closure_context_t *c) const
Offset24To< Paint > paint
void closurev1(hb_colrv1_closure_context_t *c) const
HB_INTERNAL void closurev1(hb_colrv1_closure_context_t *c) const
HB_INTERNAL void closurev1(hb_colrv1_closure_context_t *c) const
Offset24To< Paint > src
HB_INTERNAL void closurev1(hb_colrv1_closure_context_t *c) const
HB_INTERNAL void closurev1(hb_colrv1_closure_context_t *c) const
Offset24To< Paint > src
HB_INTERNAL void closurev1(hb_colrv1_closure_context_t *c) const
HB_INTERNAL void closurev1(hb_colrv1_closure_context_t *c) const
HB_INTERNAL void closurev1(hb_colrv1_closure_context_t *c) const
HB_INTERNAL void closurev1(hb_colrv1_closure_context_t *c) const
Offset24To< Paint > src
HB_INTERNAL void closurev1(hb_colrv1_closure_context_t *c) const
HB_INTERNAL void closurev1(hb_colrv1_closure_context_t *c) const
Offset24To< Paint > src