28 #ifndef HB_MS_FEATURE_RANGES_HH
29 #define HB_MS_FEATURE_RANGES_HH
50 return a->fea.tag_le <
b->fea.tag_le ? -1 :
a->fea.tag_le >
b->fea.tag_le ? 1 :
51 a->order <
b->order ? -1 :
a->order >
b->order ? 1 :
52 a->fea.value <
b->fea.value ? -1 :
a->fea.value >
b->fea.value ? 1 :
56 {
return cmp (
this, &
f) == 0; }
68 return a->index <
b->index ? -1 :
a->index >
b->index ? 1 :
69 a->start <
b->start ? -1 :
a->start >
b->start ? 1 :
82 unsigned int num_features,
91 for (
unsigned int i = 0;
i < num_features;
i++)
100 event = feature_events.
push ();
101 event->index = features[
i].
start;
103 event->feature = feature;
105 event = feature_events.
push ();
106 event->index = features[
i].
end;
107 event->start =
false;
108 event->feature = feature;
110 feature_events.
qsort ();
116 feature.
order = num_features + 1;
118 auto *
event = feature_events.
push ();
120 event->start =
false;
121 event->feature = feature;
126 unsigned int last_index = 0;
127 for (
unsigned int i = 0;
i < feature_events.
length;
i++)
129 auto *
event = &feature_events[
i];
131 if (
event->index != last_index)
137 active_features.
qsort ();
138 for (
unsigned int j = 0;
j < active_features.
length;
j++)
140 if (!
j || active_features[
j].fea.tag_le != feature_records[feature_records.
length - 1].tag_le)
142 feature_records.
push (active_features[
j].fea);
147 feature_records[feature_records.
length - 1].value = active_features[
j].fea.value;
155 range->index_first = last_index;
156 range->index_last =
event->index - 1;
158 last_index =
event->index;
167 auto *feature = active_features.
lsearch (
event->feature);
169 active_features.
remove (feature - active_features.
arrayZ);
173 if (!range_records.
length)
177 for (
unsigned int i = 0;
i < range_records.
length;
i++)
179 auto *
range = &range_records[
i];
183 return !!num_features;
189 unsigned int chars_offset,
190 unsigned int chars_len,
191 uint16_t *log_clusters,
195 range_features.
shrink (0);
198 auto *last_range = &range_records[0];
199 for (
unsigned int i = chars_offset;
i < chars_len;
i++)
201 auto *
range = last_range;
202 while (log_clusters[
i] <
range->index_first)
204 while (log_clusters[
i] >
range->index_last)
206 if (!range_features.
length ||
207 &
range->features != range_features[range_features.
length - 1])
209 auto **features = range_features.
push ();
210 auto *
c = range_counts.
push ();
213 range_features.
shrink (0);
217 *features = &
range->features;
222 range_counts[range_counts.
length - 1]++;
small capitals from c petite p scientific i
[1]
struct hb_ms_feature_t hb_ms_feature_t
struct hb_ms_features_t hb_ms_features_t
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr offset
static HB_INTERNAL int cmp(const void *pa, const void *pb)
bool operator==(const hb_ms_active_feature_t &f) const
static HB_INTERNAL int cmp(const void *pa, const void *pb)
hb_ms_active_feature_t feature
hb_ms_feature_t * features
hb_ms_features_t features
void qsort(int(*cmp)(const void *, const void *))
Type * lsearch(const T &x, Type *not_found=nullptr)
void remove(unsigned int i)
XmlOutput::xml_output tag(const QString &name)