Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[makeotf] Fixing aarch64 precision errors #1329

Merged
merged 6 commits into from
Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions c/makeotf/makeotf_lib/api/hotconv.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This software is licensed as OpenSource, under the Apache License, Version 2.0.
extern "C" {
#endif

#define HOT_VERSION 0x010076 /* Library version (1.0.118) */
#define HOT_VERSION 0x010077 /* Library version (1.0.119) */
/* Major, minor, build = (HOT_VERSION >> 16) & 0xff, (HOT_VERSION >> 8) & 0xff, HOT_VERSION & 0xff) */
/* Warning: this string is now part of heuristic used by CoolType to identify the
first round of CoolType fonts which had the backtrack sequence of a chaining
Expand Down Expand Up @@ -651,7 +651,7 @@ Blank lines, and characters following the comment char "#" on a line, are ignore
int hotAddName(hotCtx g,
unsigned short platformId, unsigned short platspecId,
unsigned short languageId, unsigned short nameId,
char *str);
signed char *str);

/* hotAddName() is called to add menu names. This name will be directly stored
in the name table using the various id arguments specified. The actual name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
08FB7793FE84155DC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1000;
LastUpgradeCheck = 1230;
};
buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "cffread" */;
compatibilityVersion = "Xcode 3.2";
Expand Down Expand Up @@ -189,6 +189,7 @@
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -229,6 +230,7 @@
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down
2 changes: 1 addition & 1 deletion c/makeotf/makeotf_lib/source/hotconv/feat.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ struct featCtx_ {
dnaDCL(unsigned short, ligCaretValues); /* List of list of caret values for current GDEF ligature glyph record.*/

/* --- Temp and misc stuff --- */
dnaDCL(char, nameString); /* Tmp for a nameid string */
dnaDCL(signed char, nameString); /* Tmp for a nameid string */
dnaDCL(MetricsInfo, metricsInfo); /* Tmp for a pos rule's metrics */
dnaDCL(AnchorMarkInfo, anchorMarkInfo); /* Tmp for a pos rule's anchor and mark info */
short mmMetric[TX_MAX_MASTERS]; /* Tmp for a mm metric */
Expand Down
6 changes: 3 additions & 3 deletions c/makeotf/makeotf_lib/source/hotconv/hot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ void hotAddMiscData(hotCtx g,

/* Prepare Windows name by converting \-format numbers to UTF-8. Return 1 on
syntax error else 0. */
static int prepWinName(hotCtx g, char *src) {
static int prepWinName(hotCtx g, signed char *src) {
/* Next state table */
static unsigned char next[5][6] = {
/* \ 0-9 a-f A-F * \0 index */
Expand Down Expand Up @@ -1213,7 +1213,7 @@ static int prepWinName(hotCtx g, char *src) {

/* Prepare Macintosh name by converting \-format numbers to bytes. Return 1 on
syntax error else 0. */
static int prepMacName(hotCtx g, char *src) {
static int prepMacName(hotCtx g, signed char *src) {
/* Next state table */
static unsigned char next[3][6] = {
/* \ 0-9 a-f A-F * \0 index */
Expand Down Expand Up @@ -1339,7 +1339,7 @@ static int prepMacName(hotCtx g, char *src) {
int hotAddName(hotCtx g,
unsigned short platformId, unsigned short platspecId,
unsigned short languageId, unsigned short nameId,
char *str) {
signed char *str) {
if ((platformId == HOT_NAME_MS_PLATFORM) ? prepWinName(g, str) : prepMacName(g, str)) {
return 1;
}
Expand Down
13 changes: 8 additions & 5 deletions c/makeotf/makeotf_lib/source/pstoken/pstoken.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct psCtx_ {
};

/* Replenish input buffer using refill function and handle end of input */
static char fillbuf(psCtx h, int check) {
static int fillbuf(psCtx h, int check) {
h->next = h->cb.psRefill(h->cb.ctx, &h->left);
if (h->left-- == 0) {
if (check) {
Expand All @@ -108,7 +108,7 @@ static char fillbuf(psCtx h, int check) {

/* Get character from PostScript input */
#define GETRAW(check) \
((unsigned char)((h->left-- == 0) ? fillbuf(h, check) : *h->next++))
((int)((h->left-- == 0) ? fillbuf(h, check) : *h->next++))

/* Get decrypted character from hexadecimal eexec encrypted font file */
static int hexdecrypt(psCtx h, int check) {
Expand Down Expand Up @@ -179,7 +179,10 @@ void psSetDecrypt(psCtx h) {

/* Get unencrypted character from font file */
static int getplain(psCtx h, int check) {
return *dnaNEXT(*h->cb.buf) = GETRAW(check);
int c;
c = GETRAW(check);
*dnaNEXT(*h->cb.buf) = c;
return c;
}

#define SKIPTODELIM \
Expand Down Expand Up @@ -695,7 +698,7 @@ double psGetReal(psCtx h) {

/* Convert string token to string value. Already validated */
char *psConvString(psCtx h, psToken *token, unsigned *length) {
*length = token->length - 2;
*length = (unsigned int) token->length - 2;
return &h->cb.buf->array[token->index + 1];
}

Expand All @@ -712,7 +715,7 @@ char *psGetString(psCtx h, unsigned *length) {

/* Convert literal token to string value. Already validated */
char *psConvLiteral(psCtx h, psToken *token, unsigned *length) {
*length = token->length - 1;
*length = (unsigned int) token->length - 1;
return &h->cb.buf->array[token->index + 1];
}

Expand Down
2 changes: 1 addition & 1 deletion c/makeotf/source/cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ static void fcdbError(void *ctx, unsigned fileid, long line, int errid) {
static int fcdbAddName(void *ctx,
unsigned short platformId, unsigned short platspecId,
unsigned short languageId, unsigned short nameId,
char *str) {
signed char *str) {
cbCtx h = ctx;
return hotAddName(h->hot.ctx,
platformId, platspecId, languageId, nameId, str);
Expand Down
4 changes: 2 additions & 2 deletions c/makeotf/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

jmp_buf mark;

#define MAKEOTF_VERSION "2.5.65603"
#define MAKEOTF_VERSION "2.5.65604"
/* Warning: this string is now part of heuristic used by CoolType to identify the
first round of CoolType fonts which had the backtrack sequence of a chaining
contextual substitution ordered incorrectly. Fonts with the old ordering MUST match
Expand Down Expand Up @@ -667,7 +667,7 @@ static void parseArgs(int argc, char *argv[], int inScript) {
}
break;
#if 0
/* This is left over from when Morisawa was demanding font protection mechanims. */
/* This is left over from when Morisawa was demanding font protection mechanisms. */
case 'A':
convert.flags |= HOT_ADD_AUTH_AREA;
break;
Expand Down
2 changes: 1 addition & 1 deletion python/afdko/makeotf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"""

__version__ = """\
makeotf.py v2.8.5 February 22 2021
makeotf.py v2.8.6 March 11 2021
"""

__methods__ = """
Expand Down