3dphotoshoot
diff libs/drawtext/font.c @ 22:d7fe157c402d
fonts
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 13 Jun 2015 05:32:07 +0300 |
parents | c71c477521ca |
children | 3d082c566b53 |
line diff
1.1 --- a/libs/drawtext/font.c Thu Jun 11 04:56:33 2015 +0300 1.2 +++ b/libs/drawtext/font.c Sat Jun 13 05:32:07 2015 +0300 1.3 @@ -31,6 +31,7 @@ 1.4 #include <ft2build.h> 1.5 #include FT_FREETYPE_H 1.6 #endif 1.7 +#include "assman.h" 1.8 #include "drawtext.h" 1.9 #include "drawtext_impl.h" 1.10 1.11 @@ -333,18 +334,18 @@ 1.12 1.13 struct dtx_glyphmap *dtx_load_glyphmap(const char *fname) 1.14 { 1.15 - FILE *fp; 1.16 + ass_file *fp; 1.17 struct dtx_glyphmap *gmap; 1.18 1.19 - if(!(fp = fopen(fname, "rb"))) { 1.20 + if(!(fp = ass_fopen(fname, "rb"))) { 1.21 return 0; 1.22 } 1.23 gmap = dtx_load_glyphmap_stream(fp); 1.24 - fclose(fp); 1.25 + ass_fclose(fp); 1.26 return gmap; 1.27 } 1.28 1.29 -struct dtx_glyphmap *dtx_load_glyphmap_stream(FILE *fp) 1.30 +struct dtx_glyphmap *dtx_load_glyphmap_stream(ass_file *fp) 1.31 { 1.32 char buf[512]; 1.33 int hdr_lines = 0; 1.34 @@ -364,7 +365,7 @@ 1.35 1.36 while(hdr_lines < 3) { 1.37 char *line = buf; 1.38 - if(!fgets(buf, sizeof buf, fp)) { 1.39 + if(!ass_fgets(buf, sizeof buf, fp)) { 1.40 fperror("unexpected end of file"); 1.41 goto err; 1.42 } 1.43 @@ -471,13 +472,13 @@ 1.44 } 1.45 1.46 for(i=0; i<num_pixels; i++) { 1.47 - long c = fgetc(fp); 1.48 + long c = ass_fgetc(fp); 1.49 if(c == -1) { 1.50 fprintf(stderr, "unexpected end of file while reading pixels\n"); 1.51 goto err; 1.52 } 1.53 gmap->pixels[i] = 255 * c / max_pixval; 1.54 - fseek(fp, 2, SEEK_CUR); 1.55 + ass_fseek(fp, 2, SEEK_CUR); 1.56 } 1.57 1.58 gmap->cstart = min_code;