Browse Source

made units per em a float

IverMartinson 4 months ago
parent
commit
20fdb16de7
4 changed files with 3 additions and 2 deletions
  1. BIN
      build/libsourparse.so
  2. BIN
      build/main.bin
  3. 2 1
      src/headers/sourparse.h
  4. 1 1
      src/library/sourparse.c

BIN
build/libsourparse.so


BIN
build/main.bin


+ 2 - 1
src/headers/sourparse.h

@@ -41,7 +41,8 @@ typedef struct {
 
 
 typedef struct {
 typedef struct {
     int current_byte, number_of_glyphs, *glyph_offsets; 
     int current_byte, number_of_glyphs, *glyph_offsets; 
-    uint16_t *unicode_to_glyph_indicies, units_per_em;
+    uint16_t *unicode_to_glyph_indicies;
+    float units_per_em;
     uint8_t *buffer;
     uint8_t *buffer;
     SP_glyph *glyphs;
     SP_glyph *glyphs;
     int16_t index_to_loca_format;
     int16_t index_to_loca_format;

+ 1 - 1
src/library/sourparse.c

@@ -326,7 +326,7 @@ SP_font* SP_load_font(char *filename){
     skip_32(font); // magic number
     skip_32(font); // magic number
     skip_16(font); // flags
     skip_16(font); // flags
 
 
-    font->units_per_em = get_u16(font);
+    font->units_per_em = (float)get_u16(font);
     
     
     // skip gibberjabber
     // skip gibberjabber
     skip_32(font); // 64 bit longdatetime
     skip_32(font); // 64 bit longdatetime