Skip to content

Commit

Permalink
Variable arithmetic infrastructure is code-complete but not tested
Browse files Browse the repository at this point in the history
Existing tests pass
Some code cleanup
Compiler fixes (mostly in spot)
  • Loading branch information
skef committed May 15, 2024
1 parent 00b9747 commit f7b31fa
Show file tree
Hide file tree
Showing 31 changed files with 659 additions and 382 deletions.
2 changes: 0 additions & 2 deletions c/addfeatures/hotconv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ add_library(hotconv OBJECT
STAT.cpp
STAT.h
uniblock.h
VarMetrics.h
VarMetrics.cpp
vmtx.cpp
vmtx.h
winansi.h
Expand Down
2 changes: 1 addition & 1 deletion c/addfeatures/hotconv/MVAR.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved.
This software is licensed as OpenSource, under the Apache License, Version 2.0. This license is available at: http://opensource.org/licenses/Apache-2.0. */
/***********************************************************************/

#include "MVAR.h"

#include "GDEF.h"
Expand Down
6 changes: 2 additions & 4 deletions c/addfeatures/hotconv/OS_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,10 +386,8 @@ int OS_2Fill(hotCtx g) {
h->tbl.sTypoLineGap = font->TypoLineGap.getDefault();
g->ctx.MVAR->addValue(MVAR_hlgp_tag, *g->ctx.locMap, font->TypoLineGap, g->logger);

h->tbl.usWinAscent = font->win.ascent.getDefault();
g->ctx.MVAR->addValue(MVAR_hcla_tag, *g->ctx.locMap, font->win.ascent, g->logger);
h->tbl.usWinDescent = font->win.descent.getDefault();
g->ctx.MVAR->addValue(MVAR_hcld_tag, *g->ctx.locMap, font->win.descent, g->logger);
h->tbl.usWinAscent = font->win.ascent;
h->tbl.usWinDescent = font->win.descent;

/* Version 2 fields */
h->tbl.sXHeight = font->win.XHeight.getDefault();
Expand Down
194 changes: 0 additions & 194 deletions c/addfeatures/hotconv/VarMetrics.cpp

This file was deleted.

51 changes: 0 additions & 51 deletions c/addfeatures/hotconv/VarMetrics.h

This file was deleted.

1 change: 1 addition & 0 deletions c/addfeatures/hotconv/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ struct hotGlyphInfo { /* Glyph information */
FWord hAdv; /* (default) Horizontal advance width */
VarValueRecord vAdv; /* Vertical advance width */
VarValueRecord vOrigY; /* Y coordinate of the glyph's vertical origin */
uint16_t vsindex; /* For CFF2 the vsindex of the glyph */
BBox bbox; /* Bounding box */
std::vector<uint32_t> sup; /* Supplementary encodings */

Expand Down
9 changes: 6 additions & 3 deletions c/addfeatures/hotconv/hmtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,22 @@ int hheaFill(hotCtx g) {
if (OVERRIDE(g->font.hheaAscender)) {
header.ascender = g->font.hheaAscender;
} else {
header.ascender = g->font.TypoAscender;
// XXX maybe just override if not read in from CFF2 otf
header.ascender = g->font.TypoAscender.getDefault();
}

if (OVERRIDE(g->font.hheaDescender)) {
header.descender = g->font.hheaDescender;
} else {
header.descender = g->font.TypoDescender;
// XXX maybe just override if not read in from CFF2 otf
header.descender = g->font.TypoDescender.getDefault();
}

if (OVERRIDE(g->font.hheaLineGap)) {
header.lineGap = g->font.hheaLineGap;
} else {
header.lineGap = g->font.TypoLineGap;
// XXX maybe just override if not read in from CFF2 otf
header.lineGap = g->font.TypoLineGap.getDefault();
}

header.advanceWidthMax = g->font.maxAdv.h;
Expand Down
Loading

0 comments on commit f7b31fa

Please sign in to comment.