aboutsummaryrefslogtreecommitdiffstats
path: root/libparsepcf_get_encoding.c
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2024-10-13 14:52:39 +0200
committerMattias Andrée <m@maandree.se>2024-10-13 14:52:39 +0200
commit3de183860fb65773c39bad2039398064679227f2 (patch)
tree29dbb38c338695a711951d5b627484c6a3a3e627 /libparsepcf_get_encoding.c
parentDocumentation and minor improvements (diff)
downloadlibparsepcf-3de183860fb65773c39bad2039398064679227f2.tar.gz
libparsepcf-3de183860fb65773c39bad2039398064679227f2.tar.bz2
libparsepcf-3de183860fb65773c39bad2039398064679227f2.tar.xz
Documentation + rename struct fields (some had confusing name, and others had plain wrong names due to bad documentation it was bsaed on)
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rw-r--r--libparsepcf_get_encoding.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libparsepcf_get_encoding.c b/libparsepcf_get_encoding.c
index 6c28c6a..86b790d 100644
--- a/libparsepcf_get_encoding.c
+++ b/libparsepcf_get_encoding.c
@@ -26,16 +26,16 @@ libparsepcf_get_encoding(const void *file, size_t size,
meta->max_byte2 = PARSE_UINT16(&text[pos + 2], msb);
meta->min_byte1 = PARSE_UINT16(&text[pos + 4], msb);
meta->max_byte1 = PARSE_UINT16(&text[pos + 6], msb);
- meta->default_char = PARSE_UINT16(&text[pos + 8], msb);
+ meta->default_glyph = PARSE_UINT16(&text[pos + 8], msb);
pos += 10;
if (meta->min_byte2 > meta->max_byte2 || meta->max_byte2 > 255 ||
meta->min_byte1 > meta->max_byte1 || meta->max_byte1 > 255)
goto ebfont;
- meta->glyph_count = (size_t)(meta->max_byte2 - meta->min_byte2 + 1);
- meta->glyph_count *= (size_t)(meta->max_byte1 - meta->min_byte1 + 1);
- if (meta->glyph_count > table->size - (pos - table->offset) / 2)
+ meta->char_count = (size_t)(meta->max_byte2 - meta->min_byte2 + 1);
+ meta->char_count *= (size_t)(meta->max_byte1 - meta->min_byte1 + 1);
+ if (meta->char_count > table->size - (pos - table->offset) / 2)
goto ebfont;
return 0;