diff --git a/dep/premake-modules/xcode-alt/xcode-alt.lua b/dep/premake-modules/xcode-alt/xcode-alt.lua
index 01e0b860..a3946d1d 100644
--- a/dep/premake-modules/xcode-alt/xcode-alt.lua
+++ b/dep/premake-modules/xcode-alt/xcode-alt.lua
@@ -15,6 +15,7 @@
include("xcode_common.lua")
include("xcode4_workspace.lua")
include("xcode_project.lua")
+ include("xcode_scheme.lua")
newaction {
trigger = "xcode4",
@@ -41,6 +42,7 @@
onProject = function(prj)
p.generate(prj, ".xcodeproj/project.pbxproj", p.modules.xcode_alt.generateProject)
+ p.generate(prj, ".xcodeproj/xcshareddata/xcschemes/" .. prj.name .. ".xcscheme", p.modules.xcode_alt.scheme.generate)
end,
}
diff --git a/dep/premake-modules/xcode-alt/xcode_common.lua b/dep/premake-modules/xcode-alt/xcode_common.lua
index 4f9e40ae..37a1462a 100644
--- a/dep/premake-modules/xcode-alt/xcode_common.lua
+++ b/dep/premake-modules/xcode-alt/xcode_common.lua
@@ -272,6 +272,9 @@
return types[node.cfg.kind]
end
+function xcode.printSettingsTable(level, settings)
+ printSettingsTable(level, settings)
+end
--
-- Return a unique file name for a project. Since Xcode uses .xcodeproj's to
@@ -368,7 +371,7 @@
local settings = {};
tree.traverse(tr, {
onnode = function(node)
- if node.buildid then
+ if node.buildid and (not node.not_a_link_dependency) then
settings[node.buildid] = function(level)
_p(level,'%s /* %s in %s */ = {isa = PBXBuildFile; fileRef = %s /* %s */; };',
node.buildid, node.name, xcode.getbuildcategory(node), node.id, node.name)
@@ -529,7 +532,7 @@
-- write out project dependencies
tree.traverse(tr.projects, {
onleaf = function(node)
- if node.buildid then
+ if node.buildid and not node.not_a_link_dependency then
_p(4,'%s /* %s in Frameworks */,', node.buildid, node.name)
end
end
diff --git a/dep/premake-modules/xcode-alt/xcode_project.lua b/dep/premake-modules/xcode-alt/xcode_project.lua
index 3f869cb9..4e6f3e4a 100644
--- a/dep/premake-modules/xcode-alt/xcode_project.lua
+++ b/dep/premake-modules/xcode-alt/xcode_project.lua
@@ -87,49 +87,50 @@
tr.products = tree.insert(tr, tree.new("Products"))
-- the special folder "Projects" lists sibling project dependencies
- tr.projects = tree.new("Projects")
- for _, dep in ipairs(project.getdependencies(prj, "sibling", "object")) do
- -- create a child node for the dependency's xcodeproj
- local xcpath = xcode.getxcodeprojname(dep)
- local xcnode = tree.insert(tr.projects, tree.new(path.getname(xcpath)))
- xcnode.path = xcpath
- xcnode.project = dep
- xcnode.productgroupid = xcode.newid(xcnode.name, "prodgrp")
- xcnode.productproxyid = xcode.newid(xcnode.name, "prodprox")
- xcnode.targetproxyid = xcode.newid(xcnode.name, "targprox")
- xcnode.targetdependid = xcode.newid(xcnode.name, "targdep")
+ tr.projects = tree.new("Projects")
+ for _, dep in ipairs(project.getdependencies(prj)) do
+ -- create a child node for the dependency's xcodeproj
+ local xcpath = xcode.getxcodeprojname(dep)
+ local xcnode = tree.insert(tr.projects, tree.new(path.getname(xcpath)))
+ xcnode.path = xcpath
+ xcnode.project = dep
+ xcnode.productgroupid = xcode.newid(xcnode.name, "prodgrp")
+ xcnode.productproxyid = xcode.newid(xcnode.name, "prodprox")
+ xcnode.targetproxyid = xcode.newid(xcnode.name, "targprox")
+ xcnode.targetdependid = xcode.newid(xcnode.name, "targdep")
+ xcnode.not_a_link_dependency = not table.contains(project.getdependencies(prj, "linkOnly"), dep)
-- create a grandchild node for the dependency's link target
- local lprj = premake.workspace.findproject(prj.workspace, dep.name)
- local cfg = project.findClosestMatch(lprj, prj.configurations[1])
- node = tree.insert(xcnode, tree.new(cfg.linktarget.name))
- node.path = cfg.linktarget.fullpath
- node.cfg = cfg
+ local lprj = premake.workspace.findproject(prj.workspace, dep.name)
+ local cfg = project.findClosestMatch(lprj, prj.configurations[1])
+ node = tree.insert(xcnode, tree.new(cfg.linktarget.name))
+ node.path = cfg.linktarget.fullpath
+ node.cfg = cfg
+ node.not_a_link_dependency = xcnode.not_a_link_dependency
end
- if #tr.projects.children > 0 then
- tree.insert(tr, tr.projects)
- end
+ if #tr.projects.children > 0 then
+ tree.insert(tr, tr.projects)
+ end
-- Final setup
- tree.traverse(tr, {
- onnode = function(node)
- -- assign IDs to every node in the tree
- node.id = xcode.newid(node.name, nil, node.path)
-
- node.isResource = xcode.isItemResource(prj, node)
-
- -- assign build IDs to buildable files
- if xcode.getbuildcategory(node) then
- node.buildid = xcode.newid(node.name, "build", node.path)
- end
-
- -- remember key files that are needed elsewhere
- if string.endswith(node.name, "Info.plist") then
- tr.infoplist = node
- end
- end
- }, true)
+ tree.traverse(tr, {
+ onnode = function(node)
+ -- assign IDs to every node in the tree
+ node.id = xcode.newid(node.name, nil, node.path)
+ node.isResource = xcode.isItemResource(prj, node)
+
+ -- assign build IDs to buildable files
+ if xcode.getbuildcategory(node) then
+ node.buildid = xcode.newid(node.name, "build", node.path)
+ end
+
+ -- remember key files that are needed elsewhere
+ if string.endswith(node.name, "Info.plist") then
+ tr.infoplist = node
+ end
+ end
+ }, true)
-- Plug in the product node into the Products folder in the tree. The node
-- was built in xcode.prepareWorkspace() in xcode_common.lua; it contains IDs
diff --git a/dep/premake-modules/xcode-alt/xcode_scheme.lua b/dep/premake-modules/xcode-alt/xcode_scheme.lua
new file mode 100644
index 00000000..494af13d
--- /dev/null
+++ b/dep/premake-modules/xcode-alt/xcode_scheme.lua
@@ -0,0 +1,139 @@
+---
+-- xcode/xcode4_scheme.lua
+-- Generate a shared scheme for an Xcode C/C++ project.
+-- Copyright (c) 2009-2016 Jason Perkins and the Premake project
+---
+
+local p = premake
+local m = p.modules.xcode_alt
+
+local project = p.project
+local config = p.config
+local fileconfig = p.fileconfig
+local tree = p.tree
+
+m.scheme = {}
+local scheme = m.scheme
+
+function scheme.Header(prj)
+ p.w('')
+ p.push('')
+end
+
+function scheme.Footer(prj)
+ p.pop('')
+end
+
+function scheme.buildablereference(prj)
+ local tr = project.getsourcetree(prj)
+ for _, node in ipairs(tr.products.children) do
+ p.push('', tr.name)
+ p.pop('')
+ end
+end
+
+function scheme.build(prj)
+ p.push('')
+ p.push('')
+ p.push('')
+ scheme.buildablereference(prj)
+ p.pop('')
+ p.pop('')
+ p.pop('')
+end
+
+function scheme.test(prj)
+ p.push('')
+ p.push('')
+ p.pop('')
+ p.push('')
+ scheme.buildablereference(prj)
+ p.pop('')
+ p.pop('')
+end
+
+function scheme.launch(prj)
+ p.push('')
+ p.push('')
+ scheme.buildablereference(prj)
+ p.pop('')
+ p.push('')
+ p.pop('')
+ p.pop('')
+end
+
+function scheme.profile(prj)
+ p.push('')
+ p.push('')
+ scheme.buildablereference(prj)
+ p.pop('')
+ p.pop('')
+end
+
+function scheme.analyze(prj)
+ p.push('')
+ p.pop('')
+end
+
+function scheme.archive(prj)
+ p.push('')
+ p.pop('')
+end
+
+--
+-- Generate the shared data scheme for an xcode project
+--
+-- @param prj
+-- The Premake project to generate.
+--
+
+m.scheme.project = function(prj)
+ return {
+ scheme.Header,
+ scheme.build,
+ scheme.test,
+ scheme.launch,
+ scheme.profile,
+ scheme.analyze,
+ scheme.archive,
+ scheme.Footer,
+ }
+end
+
+function m.scheme.generate(prj)
+ p.callArray(m.scheme.project, prj)
+end
diff --git a/lib/font/caryll-font.c b/lib/font/caryll-font.c
index 43f8cb5a..354c4868 100644
--- a/lib/font/caryll-font.c
+++ b/lib/font/caryll-font.c
@@ -136,10 +136,17 @@ json_value *caryll_font_to_json(caryll_font *font, caryll_options *options) {
return root;
}
+caryll_font_subtype caryll_decide_font_subtype_json(json_value *root) {
+ if (json_obj_get_type(root, "CFF_", json_object) != NULL) {
+ return FONTTYPE_CFF;
+ } else {
+ return FONTTYPE_TTF;
+ }
+}
caryll_font *caryll_font_from_json(json_value *root, caryll_options *options) {
caryll_font *font = caryll_new_font();
if (!font) return NULL;
- font->subtype = json_obj_get_type(root, "CFF_", json_object) != NULL;
+ font->subtype = caryll_decide_font_subtype_json(root);
font->glyph_order = caryll_glyphorder_from_json(root, options);
font->head = caryll_head_from_json(root, options);
font->hhea = caryll_hhea_from_json(root, options);
@@ -194,15 +201,16 @@ caryll_buffer *caryll_write_font(caryll_font *font, caryll_options *options) {
if (font->LTSH) sfnt_builder_push_table(builder, 'LTSH', caryll_write_LTSH(font->LTSH, options));
}
- sfnt_builder_push_table(builder, 'hmtx',
- caryll_write_hmtx(font->hmtx, font->hhea->numberOfMetrics,
- font->maxp->numGlyphs - font->hhea->numberOfMetrics, options));
-
+ if (font->hhea && font->maxp && font->hmtx) {
+ uint16_t hmtx_counta = font->hhea->numberOfMetrics;
+ uint16_t hmtx_countk = font->maxp->numGlyphs - font->hhea->numberOfMetrics;
+ sfnt_builder_push_table(builder, 'hmtx', caryll_write_hmtx(font->hmtx, hmtx_counta, hmtx_countk, options));
+ }
if (font->vhea) sfnt_builder_push_table(builder, 'vhea', caryll_write_vhea(font->vhea, options));
- if (font->vmtx) {
- sfnt_builder_push_table(builder, 'vmtx',
- caryll_write_vmtx(font->vmtx, font->vhea->numOfLongVerMetrics,
- font->maxp->numGlyphs - font->vhea->numOfLongVerMetrics, options));
+ if (font->vhea && font->maxp && font->vmtx) {
+ uint16_t vmtx_counta = font->vhea->numOfLongVerMetrics;
+ uint16_t vmtx_countk = font->maxp->numGlyphs - font->vhea->numOfLongVerMetrics;
+ sfnt_builder_push_table(builder, 'vmtx', caryll_write_vmtx(font->vmtx, vmtx_counta, vmtx_countk, options));
}
if (font->VORG) { sfnt_builder_push_table(builder, 'VORG', caryll_write_VORG(font->VORG, options)); }
diff --git a/lib/font/caryll-font.h b/lib/font/caryll-font.h
index 9ca2964e..cb4a2e74 100644
--- a/lib/font/caryll-font.h
+++ b/lib/font/caryll-font.h
@@ -70,6 +70,7 @@ struct _caryll_font {
};
caryll_font_subtype caryll_decide_font_subtype(caryll_sfnt *sfnt, uint32_t index);
+caryll_font_subtype caryll_decide_font_subtype_json(json_value *root);
caryll_font *caryll_new_font();
caryll_font *caryll_read_font(caryll_sfnt *sfnt, uint32_t index);
void caryll_delete_font(caryll_font *font);
diff --git a/lib/fontops/consolidate.c b/lib/fontops/consolidate.c
index a722a491..b0ddf8d2 100644
--- a/lib/fontops/consolidate.c
+++ b/lib/fontops/consolidate.c
@@ -106,6 +106,30 @@ void caryll_font_consolidate_glyph(glyf_glyph *g, caryll_font *font) {
}
free(hmap);
free(vmap);
+ // Consolidate fdSelect
+ if (g->fdSelect.name && font->CFF_ && font->CFF_->fdArray) {
+ bool found = false;
+ for (uint16_t j = 0; j < font->CFF_->fdArrayCount; j++) {
+ if (strcmp(g->fdSelect.name, font->CFF_->fdArray[j]->fontName) == 0) {
+ found = true;
+ sdsfree(g->fdSelect.name);
+ g->fdSelect.name = font->CFF_->fdArray[j]->fontName;
+ g->fdSelect.index = j;
+ break;
+ }
+ }
+ if (!found) {
+ fprintf(stderr, "[Consolidate] CID Subfont %s is not defined. (in glyph /%s).\n", g->fdSelect.name,
+ g->name);
+ sdsfree(g->fdSelect.name);
+ g->fdSelect.name = NULL;
+ g->fdSelect.index = 0;
+ }
+ } else if (g->fdSelect.name) {
+ sdsfree(g->fdSelect.name);
+ g->fdSelect.name = NULL;
+ g->fdSelect.index = 0;
+ }
}
void caryll_font_consolidate_glyf(caryll_font *font) {
diff --git a/lib/fontops/unconsolidate.c b/lib/fontops/unconsolidate.c
index 71103243..7a6b1f58 100644
--- a/lib/fontops/unconsolidate.c
+++ b/lib/fontops/unconsolidate.c
@@ -242,6 +242,18 @@ static void caryll_name_features(caryll_font *font) {
if (font->GDEF->ligCarets) { name_coverage(font, font->GDEF->ligCarets->coverage); }
}
}
+
+static void caryll_name_fdselect(caryll_font *font) {
+ if (font->CFF_ && font->glyf && font->CFF_->fdArray) {
+ for (uint16_t j = 0; j < font->glyf->numberGlyphs; j++) {
+ glyf_glyph *g = font->glyf->glyphs[j];
+ if (g->fdSelect.index < font->CFF_->fdArrayCount) {
+ g->fdSelect.name = font->CFF_->fdArray[g->fdSelect.index]->fontName;
+ }
+ }
+ }
+}
+
static void merge_hmtx(caryll_font *font) {
// Merge hmtx table into glyf.
if (font->hhea && font->hmtx && font->glyf) {
@@ -295,4 +307,5 @@ void caryll_font_unconsolidate(caryll_font *font, caryll_options *options) {
caryll_name_cmap_entries(font);
caryll_name_glyf(font);
caryll_name_features(font);
+ caryll_name_fdselect(font);
}
diff --git a/lib/libcff/charstring_il.h b/lib/libcff/charstring_il.h
index b12f296b..8af18043 100644
--- a/lib/libcff/charstring_il.h
+++ b/lib/libcff/charstring_il.h
@@ -14,9 +14,11 @@ typedef enum {
typedef struct {
il_type type;
- double d;
- int32_t i;
uint16_t arity;
+ union {
+ double d; // for type == IL_ITEM_OPERAND, IL_ITEM_PHANTOM_OPERAND
+ int32_t i; // otherwise
+ };
} charstring_instruction;
typedef struct {
diff --git a/lib/support/util.h b/lib/support/util.h
index 4f383be3..0cbe1c38 100644
--- a/lib/support/util.h
+++ b/lib/support/util.h
@@ -314,6 +314,12 @@ typedef struct {
sds name;
} glyph_handle;
+// fd reference type
+typedef struct {
+ uint16_t index;
+ sds name;
+} fd_handle;
+
#define MOVE /*move*/
static INLINE json_value *preserialize(MOVE json_value *x) {
@@ -357,9 +363,9 @@ static INLINE void *__caryll_allocate_clean(size_t n, unsigned long line) {
#define FREE(ptr) (free(ptr), ptr = nullptr)
#define DELETE(fn, ptr) (fn(ptr), ptr = nullptr)
#else
-#define NEW(ptr) ptr = __caryll_allocate(sizeof(__typeof__(*ptr)), __LINE__)
-#define NEW_CLEAN(ptr) ptr = __caryll_allocate_clean(sizeof(__typeof__(*ptr)), __LINE__)
-#define NEW_N(ptr, n) ptr = __caryll_allocate(sizeof(__typeof__(*ptr)) * (n), __LINE__)
+#define NEW(ptr) ptr = __caryll_allocate(sizeof(*ptr), __LINE__)
+#define NEW_CLEAN(ptr) ptr = __caryll_allocate_clean(sizeof(*ptr), __LINE__)
+#define NEW_N(ptr, n) ptr = __caryll_allocate(sizeof(*ptr) * (n), __LINE__)
#define FREE(ptr) (free(ptr), ptr = NULL)
#define DELETE(fn, ptr) (fn(ptr), ptr = NULL)
#endif
diff --git a/lib/tables/CFF.c b/lib/tables/CFF.c
index 66cbe042..2fd7ad9d 100644
--- a/lib/tables/CFF.c
+++ b/lib/tables/CFF.c
@@ -427,7 +427,7 @@ static void buildOutline(uint16_t i, cff_parse_context *context) {
else
fd = parse_subr(i, f->raw_data, f->top_dict, f->fdselect, &localSubrs);
- g->fdSelectIndex = fd;
+ g->fdSelect.index = fd;
if (context->meta->fdArray && fd >= 0 && fd < context->meta->fdArrayCount &&
context->meta->fdArray[fd]->privateDict) {
bc.defaultWidthX = context->meta->fdArray[fd]->privateDict->defaultWidthX;
@@ -573,6 +573,9 @@ caryll_cff_parse_result caryll_read_CFF_and_glyf(caryll_packet packet) {
parse_dict_callback(cffFile->font_dict.data + cffFile->font_dict.offset[j] - 1,
cffFile->font_dict.offset[j + 1] - cffFile->font_dict.offset[j], &context,
callback_extract_fd);
+ if (!context.meta->fdArray[j]->fontName) {
+ context.meta->fdArray[j]->fontName = sdscatprintf(sdsempty(), "_Subfont%d", j);
+ }
}
}
ret.meta = context.meta;
@@ -674,9 +677,12 @@ static json_value *fdToJson(table_CFF *table) {
json_object_push(_CFF_, "cidSupplement", json_double_new(table->cidSupplement));
}
if (table->fdArray) {
- json_value *_fdArray = json_array_new(table->fdArrayCount);
+ json_value *_fdArray = json_object_new(table->fdArrayCount);
for (uint16_t j = 0; j < table->fdArrayCount; j++) {
- json_array_push(_fdArray, fdToJson(table->fdArray[j]));
+ sds name = table->fdArray[j]->fontName;
+ table->fdArray[j]->fontName = NULL;
+ json_object_push(_fdArray, name, fdToJson(table->fdArray[j]));
+ table->fdArray[j]->fontName = name;
}
json_object_push(_CFF_, "fdArray", _fdArray);
}
@@ -771,13 +777,16 @@ static table_CFF *fdFromJson(json_value *dump) {
table->cidFontRevision = json_obj_getnum(dump, "cidFontRevision");
// fdArray
- json_value *fdarraydump = json_obj_get_type(dump, "fdArray", json_array);
+ json_value *fdarraydump = json_obj_get_type(dump, "fdArray", json_object);
if (fdarraydump && table->cidRegistry && table->cidOrdering) {
table->isCID = true;
- table->fdArrayCount = fdarraydump->u.array.length;
+ table->fdArrayCount = fdarraydump->u.object.length;
NEW_N(table->fdArray, table->fdArrayCount);
for (uint16_t j = 0; j < table->fdArrayCount; j++) {
- table->fdArray[j] = fdFromJson(fdarraydump->u.array.values[j]);
+ table->fdArray[j] = fdFromJson(fdarraydump->u.object.values[j].value);
+ if (table->fdArray[j]->fontName) { sdsfree(table->fdArray[j]->fontName); }
+ table->fdArray[j]->fontName =
+ sdsnewlen(fdarraydump->u.object.values[j].name, fdarraydump->u.object.values[j].name_length);
}
}
if (!table->privateDict) table->privateDict = caryll_new_CFF_private();
@@ -1055,11 +1064,11 @@ static caryll_buffer *cff_make_fdselect(table_CFF *cff, table_glyf *glyf) {
NEW_CLEAN(fds);
fds->t = CFF_FDSELECT_UNSPECED;
if (!glyf->numberGlyphs) goto done;
- uint8_t fdi0 = glyf->glyphs[0]->fdSelectIndex;
+ uint8_t fdi0 = glyf->glyphs[0]->fdSelect.index;
if (fdi0 > cff->fdArrayCount) fdi0 = 0;
current = fdi0;
for (uint16_t j = 1; j < glyf->numberGlyphs; j++) {
- uint8_t fdi = glyf->glyphs[j]->fdSelectIndex;
+ uint8_t fdi = glyf->glyphs[j]->fdSelect.index;
if (fdi > cff->fdArrayCount) fdi = 0;
if (fdi != current) {
current = fdi;
@@ -1070,9 +1079,9 @@ static caryll_buffer *cff_make_fdselect(table_CFF *cff, table_glyf *glyf) {
fds->f3.range3[0].first = 0;
fds->f3.range3[0].fd = current = fdi0;
for (uint16_t j = 1; j < glyf->numberGlyphs; j++) {
- uint8_t fdi = glyf->glyphs[j]->fdSelectIndex;
+ uint8_t fdi = glyf->glyphs[j]->fdSelect.index;
if (fdi > cff->fdArrayCount) fdi = 0;
- if (glyf->glyphs[j]->fdSelectIndex != current) {
+ if (glyf->glyphs[j]->fdSelect.index != current) {
current = fdi;
fds->s++;
fds->f3.range3[fds->s].first = j;
diff --git a/lib/tables/CFF.h b/lib/tables/CFF.h
index 83a13aff..561b2515 100644
--- a/lib/tables/CFF.h
+++ b/lib/tables/CFF.h
@@ -51,6 +51,10 @@ typedef struct {
typedef struct _table_CFF table_CFF;
struct _table_CFF {
+ // Name
+ sds fontName;
+
+ // General properties
bool isCID;
sds version;
sds notice;
@@ -71,7 +75,6 @@ struct _table_CFF {
cff_fontmatrix *fontMatrix;
// CID-only operators
- sds fontName;
sds cidRegistry;
sds cidOrdering;
uint32_t cidSupplement;
diff --git a/lib/tables/glyf.c b/lib/tables/glyf.c
index 22b71b1f..8ae79643 100644
--- a/lib/tables/glyf.c
+++ b/lib/tables/glyf.c
@@ -23,7 +23,8 @@ glyf_glyph *caryll_new_glyf_glyph() {
g->stemV = NULL;
g->hintMasks = NULL;
g->contourMasks = NULL;
- g->fdSelectIndex = 0;
+ g->fdSelect.index = 0;
+ g->fdSelect.name = NULL;
g->yPel = 0;
g->stat.xMin = 0;
@@ -441,7 +442,6 @@ static json_value *glyf_glyph_maskdefs_to_json(glyf_postscript_hint_mask *masks,
static json_value *glyf_glyph_to_json(glyf_glyph *g, caryll_options *options) {
json_value *glyph = json_object_new(12);
- if (options->export_fdselect) { json_object_push(glyph, "fdSelectIndex", json_integer_new(g->fdSelectIndex)); }
json_object_push(glyph, "advanceWidth", json_integer_new(g->advanceWidth));
if (options->has_vertical_metrics) {
json_object_push(glyph, "advanceHeight", json_integer_new(g->advanceHeight));
@@ -468,7 +468,8 @@ static json_value *glyf_glyph_to_json(glyf_glyph *g, caryll_options *options) {
preserialize(glyf_glyph_maskdefs_to_json(g->contourMasks, g->numberOfContourMasks,
g->numberOfStemH, g->numberOfStemV)));
}
- if (g->yPel) { json_object_push(glyph, "yPel", json_integer_new(g->yPel)); }
+ if (options->export_fdselect) { json_object_push(glyph, "CFF_fdSelect", json_string_new(g->fdSelect.name)); }
+ if (g->yPel) { json_object_push(glyph, "LTSH_yPel", json_integer_new(g->yPel)); }
return glyph;
}
void caryll_glyphorder_to_json(table_glyf *table, json_value *root) {
@@ -642,8 +643,6 @@ static glyf_glyph *caryll_glyf_glyph_from_json(json_value *glyphdump, glyph_orde
g->advanceWidth = json_obj_getint(glyphdump, "advanceWidth");
g->advanceHeight = json_obj_getint(glyphdump, "advanceHeight");
g->verticalOrigin = json_obj_getint(glyphdump, "verticalOrigin");
- g->fdSelectIndex = json_obj_getint(glyphdump, "fdSelectIndex");
- g->yPel = json_obj_getint(glyphdump, "yPel");
glyf_contours_from_json(json_obj_get_type(glyphdump, "contours", json_array), g);
glyf_references_from_json(json_obj_get_type(glyphdump, "references", json_array), g);
if (!options->ignore_hints) {
@@ -655,6 +654,10 @@ static glyf_glyph *caryll_glyf_glyph_from_json(json_value *glyphdump, glyph_orde
masks_from_json(json_obj_get_type(glyphdump, "contourMasks", json_array), &(g->numberOfContourMasks),
&(g->contourMasks));
}
+ // Glyph data of other tables
+ g->fdSelect.name = json_obj_getsds(glyphdump, "CFF_fdSelect");
+ g->yPel = json_obj_getint(glyphdump, "LTSH_yPel");
+ if (!g->yPel) { g->yPel = json_obj_getint(glyphdump, "yPel"); }
return g;
}
diff --git a/lib/tables/glyf.h b/lib/tables/glyf.h
index 33eabc28..2ac7a6aa 100644
--- a/lib/tables/glyf.h
+++ b/lib/tables/glyf.h
@@ -96,7 +96,7 @@ typedef struct {
uint8_t yPel;
// CID FDSelect
- uint16_t fdSelectIndex;
+ fd_handle fdSelect;
// Stats
glyf_glyph_stat stat;
diff --git a/makefile b/makefile
index e8fde904..0cb8445c 100644
--- a/makefile
+++ b/makefile
@@ -1,4 +1,4 @@
-VERSION=0.2.4
+VERSION=0.3.0
ifndef PREMAKE5
PREMAKE5=premake5
diff --git a/premake5.lua b/premake5.lua
index 742e3bb0..3eb115a5 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -40,8 +40,8 @@ workspace "otfcc"
defines {
'_CARYLL_USE_PRE_SERIALIZED',
'MAIN_VER=0',
- "SECONDARY_VER=2",
- "PATCH_VER=4"
+ "SECONDARY_VER=3",
+ "PATCH_VER=0"
}
location "build"