diff -ru MPlayer-1.0pre7-orig/cfg-common.h MPlayer-1.0pre7/cfg-common.h
|
old
|
new
|
|
| 278 | 278 | {"subfont-blur", &subtitle_font_radius, CONF_TYPE_FLOAT, CONF_RANGE, 0, 8, NULL}, |
| 279 | 279 | {"subfont-outline", &subtitle_font_thickness, CONF_TYPE_FLOAT, CONF_RANGE, 0, 8, NULL}, |
| 280 | 280 | {"subfont-autoscale", &subtitle_autoscale, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL}, |
| | 281 | {"subfont-ratio", &subtitle_font_ratio, CONF_TYPE_FLOAT, CONF_RANGE, 0.01, 100.0, NULL }, |
| 281 | 282 | #endif |
| 282 | 283 | #ifdef HAVE_FONTCONFIG |
| 283 | 284 | {"fontconfig", &font_fontconfig, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |
diff -ru MPlayer-1.0pre7-orig/libvo/font_load.h MPlayer-1.0pre7/libvo/font_load.h
|
old
|
new
|
|
| 70 | 70 | extern float osd_font_scale_factor; |
| 71 | 71 | extern float subtitle_font_radius; |
| 72 | 72 | extern float subtitle_font_thickness; |
| | 73 | extern float subtitle_font_ratio; |
| 73 | 74 | extern int subtitle_autoscale; |
| 74 | 75 | |
| 75 | 76 | extern int vo_image_width; |
diff -ru MPlayer-1.0pre7-orig/libvo/font_load_ft.c MPlayer-1.0pre7/libvo/font_load_ft.c
|
old
|
new
|
|
| 45 | 45 | float osd_font_scale_factor = 6.0; |
| 46 | 46 | float subtitle_font_radius = 2.0; |
| 47 | 47 | float subtitle_font_thickness = 2.0; |
| | 48 | float subtitle_font_ratio = 1.0; |
| 48 | 49 | // 0 = no autoscale |
| 49 | 50 | // 1 = video height |
| 50 | 51 | // 2 = video width |
| … |
… |
|
| 123 | 124 | int width, height; |
| 124 | 125 | unsigned char *bbuffer; |
| 125 | 126 | int i, uni_charmap = 1; |
| | 127 | float xppem = ppem, yppem = ppem * subtitle_font_ratio; |
| 126 | 128 | |
| 127 | 129 | error = FT_Select_Charmap(face, ft_encoding_unicode); |
| 128 | 130 | // fprintf(stderr, "select unicode charmap: %d\n", error); |
| … |
… |
|
| 136 | 138 | |
| 137 | 139 | /* set size */ |
| 138 | 140 | if (FT_IS_SCALABLE(face)) { |
| 139 | | error = FT_Set_Char_Size(face, 0, floatTof266(ppem), 0, 0); |
| | 141 | error = FT_Set_Char_Size(face, floatTof266(xppem), floatTof266(yppem), 0, 0); |
| 140 | 142 | if (error) WARNING("FT_Set_Char_Size failed."); |
| 141 | 143 | } else { |
| 142 | 144 | int j = 0; |
| … |
… |
|
| 190 | 192 | // fprintf(stderr, "font height: %lf\n", (double)(face->bbox.yMax-face->bbox.yMin)/(double)face->units_per_EM*ppem); |
| 191 | 193 | // fprintf(stderr, "font width: %lf\n", (double)(face->bbox.xMax-face->bbox.xMin)/(double)face->units_per_EM*ppem); |
| 192 | 194 | |
| 193 | | ymax = (double)(face->bbox.yMax)/(double)face->units_per_EM*ppem+1; |
| 194 | | ymin = (double)(face->bbox.yMin)/(double)face->units_per_EM*ppem-1; |
| | 195 | ymax = (double)(face->bbox.yMax)/(double)face->units_per_EM*yppem+1; |
| | 196 | ymin = (double)(face->bbox.yMin)/(double)face->units_per_EM*yppem-1; |
| 195 | 197 | |
| 196 | | width = ppem*(face->bbox.xMax-face->bbox.xMin)/face->units_per_EM+3+2*padding; |
| | 198 | width = xppem*(face->bbox.xMax-face->bbox.xMin)/face->units_per_EM+3+2*padding; |
| 197 | 199 | if (desc->max_width < width) desc->max_width = width; |
| 198 | 200 | width = ALIGN(width); |
| 199 | 201 | desc->pic_b[pic_idx]->charwidth = width; |