summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <shausman@rhea.troll.no>2007-02-26 17:54:26 +0100
committerSimon Hausmann <shausman@rhea.troll.no>2007-03-28 12:52:35 +0200
commitb17ad5fe61d3ea530c132fa8b0328ae3db22948c (patch)
treef16043687057557592061a84867477e63e887e01 /src
parent658d2c3e2fda9e1ac52c067386b7e82c2aa318ad (diff)
Make it possible for the calling application to provide the glyph indices in
advance
Diffstat (limited to 'src')
-rw-r--r--src/harfbuzz-shaper-private.h6
-rw-r--r--src/harfbuzz-shaper.cpp12
-rw-r--r--src/harfbuzz-shaper.h3
3 files changed, 16 insertions, 5 deletions
diff --git a/src/harfbuzz-shaper-private.h b/src/harfbuzz-shaper-private.h
index 2b9b4f5..ffa0a6c 100644
--- a/src/harfbuzz-shaper-private.h
+++ b/src/harfbuzz-shaper-private.h
@@ -121,11 +121,7 @@ void HB_HeuristicSetGlyphAttributes(HB_ShaperItem *item);
|| (uc >= 0x2028 && uc <= 0x202f /* LS, PS, LRE, RLE, PDF, LRO, RLO, NNBSP */) \
|| (uc >= 0x206a && uc <= 0x206f /* ISS, ASS, IAFS, AFS, NADS, NODS */))
-#define HB_StringToGlyphs(shaper_item) \
- shaper_item->font->klass->stringToGlyphs(shaper_item->font, \
- shaper_item->string + shaper_item->item.pos, shaper_item->item.length, \
- shaper_item->glyphs, &shaper_item->num_glyphs, \
- shaper_item->item.bidiLevel % 2)
+HB_Bool HB_StringToGlyphs(HB_ShaperItem *shaper_item);
#define HB_GetAdvances(shaper_item) \
shaper_item->font->klass->getAdvances(shaper_item->font, \
diff --git a/src/harfbuzz-shaper.cpp b/src/harfbuzz-shaper.cpp
index 71e643b..b177812 100644
--- a/src/harfbuzz-shaper.cpp
+++ b/src/harfbuzz-shaper.cpp
@@ -514,6 +514,18 @@ static const HB_OpenTypeFeature basic_features[] = {
};
#endif
+HB_Bool HB_StringToGlyphs(HB_ShaperItem *shaper_item)
+{
+ if (shaper_item->glyphIndicesPresent) {
+ shaper_item->num_glyphs = shaper_item->initialGlyphCount;
+ return true;
+ }
+ return shaper_item->font->klass->stringToGlyphs(shaper_item->font,
+ shaper_item->string + shaper_item->item.pos, shaper_item->item.length,
+ shaper_item->glyphs, &shaper_item->num_glyphs,
+ shaper_item->item.bidiLevel % 2);
+}
+
HB_Bool HB_BasicShape(HB_ShaperItem *shaper_item)
{
#ifndef NO_OPENTYPE
diff --git a/src/harfbuzz-shaper.h b/src/harfbuzz-shaper.h
index 59ddfa1..64148f2 100644
--- a/src/harfbuzz-shaper.h
+++ b/src/harfbuzz-shaper.h
@@ -212,6 +212,9 @@ typedef struct {
HB_Face face;
int shaperFlags; /* HB_ShaperFlags */
+ HB_Bool glyphIndicesPresent; /* set to true if the glyph indicies are already setup in the glyphs array */
+ uint32_t initialGlyphCount;
+
uint32_t num_glyphs; /* in: available glyphs out: glyphs used/needed */
HB_Glyph *glyphs; /* out parameter */
HB_GlyphAttributes *attributes; /* out */