1
0
Fork 0
forked from len0rd/rockbox

convttf: Switch to c99 fixed size integers for fnt file header

Change-Id: Idff55a88a9bddaec42e568cf3c3ff3f6df15ec34
This commit is contained in:
Solomon Peachy 2025-05-23 08:44:46 -04:00
parent adaae1731f
commit 2f6ecaf3c2

View file

@ -35,6 +35,7 @@
#include FT_TRUETYPE_TABLES_H
#include <string.h>
#include <stdint.h>
/*
* Set the default values used to generate a BDF font.
*/
@ -114,26 +115,26 @@ int trim_aa = 0; /* trim ascent actual */
int ft_load_opts = FT_LOAD_RENDER | FT_LOAD_NO_BITMAP;
struct font_header_struct {
char header[4]; /* magic number and version bytes */
unsigned short maxwidth; /* max width in pixels */
unsigned short height; /* height in pixels */
unsigned short ascent; /* ascent (baseline) height */
unsigned short depth; /* depth 0=1-bit, 1=4-bit */
unsigned long firstchar; /* first character in font */
unsigned long defaultchar; /* default character in font */
unsigned long size; /* # characters in font */
unsigned long nbits; /* # bytes imagebits data in file */ /* = bits_size */
uint8_t header[4]; /* magic number and version bytes */
uint16_t maxwidth; /* max width in pixels */
uint16_t height; /* height in pixels */
uint16_t ascent; /* ascent (baseline) height */
uint16_t depth; /* depth 0=1-bit, 1=4-bit */
uint32_t firstchar; /* first character in font */
uint32_t defaultchar; /* default character in font */
uint32_t size; /* # characters in font */
uint32_t nbits; /* # bytes imagebits data in file */ /* = bits_size */
FT_Long noffset; /* # longs offset data in file */
FT_Long nwidth; /* # bytes width data in file */
uint32_t noffset; /* # longs offset data in file */
uint32_t nwidth; /* # bytes width data in file */
};
struct font_struct {
struct font_header_struct header;
unsigned char *chars_data;
unsigned short *offset;
FT_Long *offset_long;
unsigned char *width;
uint8_t *chars_data;
uint16_t *offset;
uint32_t *offset_long;
uint8_t *width;
};
struct ttc_table{
@ -629,7 +630,7 @@ void convttf(char* path, char* destfile, FT_Long face_index)
unsigned char pixel_per_byte = CHAR_BIT / bit_shift;
struct font_struct export_font;
char pad[] = {0,0,0,0};
int skip,i;
unsigned int skip,i;
FILE *file;
/* Initialize engine */