summaryrefslogtreecommitdiff
path: root/src/sfnt.h
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2023-03-24 10:43:34 +0800
committerPo Lu <luangruo@yahoo.com>2023-03-24 10:43:34 +0800
commitb78ef9bcd1bf34bec877b4fd30f2bbb97cb0919c (patch)
tree08edd2217ebdc9d390db0395065e949241c4191d /src/sfnt.h
parentb26b4c537bb031027dafd4dccda6a8cc5874ce4d (diff)
Update Android port
* src/sfnt.c (sfnt_table_names): Add fvar, gvar, cvar. (sfnt_read_maxp_table): Call xmalloc, not malloc. (sfnt_read_simple_glyph): Avoid use-after-free if simple is invalid. (sfnt_fill_span): Fix max coverage. (sfnt_normalize_vector): Fail if magnitude is zero. (sfnt_measure_distance): Fix opcode order. (sfnt_dot_fix_14): Fix implementation. (struct sfnt_variation_axis, struct sfnt_instance) (struct sfnt_fvar_table, struct sfnt_gvar_table) (sfnt_read_fvar_table, sfnt_read_gvar_table, struct sfnt_blend) (sfnt_init_blend, sfnt_free_blend, sfnt_normalize_blend) (struct sfnt_tuple_header, struct sfnt_gvar_glyph_header) (sfnt_read_packed_points, sfnt_read_packed_deltas) (sfnt_compute_tuple_scale, sfnt_infer_deltas_1, sfnt_infer_deltas) (sfnt_vary_glyph): Add WIP variation glyph implementation. * src/sfnt.h (enum sfnt_table, struct sfnt_simple_glyph): Likewise.
Diffstat (limited to 'src/sfnt.h')
-rw-r--r--src/sfnt.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/sfnt.h b/src/sfnt.h
index 83d34bfb757..82fa343f51d 100644
--- a/src/sfnt.h
+++ b/src/sfnt.h
@@ -53,6 +53,9 @@ enum sfnt_table
SFNT_TABLE_CVT ,
SFNT_TABLE_FPGM,
SFNT_TABLE_PREP,
+ SFNT_TABLE_FVAR,
+ SFNT_TABLE_GVAR,
+ SFNT_TABLE_CVAR,
};
#define SFNT_ENDOF(type, field, type1) \
@@ -61,7 +64,14 @@ enum sfnt_table
/* Each of these structures must be aligned so that no compiler will
ever generate padding bytes on platforms where the alignment
requirements for uint32_t and uint16_t are no larger than 4 and 2
- bytes respectively. */
+ bytes respectively.
+
+ Pointer types are assumed to impose an alignmnent requirement no
+ less than that of uint32_t.
+
+ If a table has more than one kind of variable-length subtable array
+ at the end, make sure to pad subsequent subtables
+ appropriately. */
struct sfnt_offset_subtable
{
@@ -568,25 +578,25 @@ struct sfnt_simple_glyph
size_t number_of_points;
/* Array containing the last points of each contour. */
- uint16_t *end_pts_of_contours;
+ uint16_t *restrict end_pts_of_contours;
/* Total number of bytes needed for instructions. */
uint16_t instruction_length;
/* Instruction data. */
- uint8_t *instructions;
+ uint8_t *restrict instructions;
/* Array of flags. */
- uint8_t *flags;
+ uint8_t *restrict flags;
/* Array of X coordinates. */
- int16_t *x_coordinates;
+ int16_t *restrict x_coordinates;
/* Array of Y coordinates. */
- int16_t *y_coordinates;
+ int16_t *restrict y_coordinates;
/* Pointer to the end of that array. */
- int16_t *y_coordinates_end;
+ int16_t *restrict y_coordinates_end;
};
struct sfnt_compound_glyph_component