Mercurial > mplayer.hg
comparison libass/ass_font.c @ 22210:4a958bd08920
Select the first charmap in the font, if FreeType did not autoselect any.
This happens, for example, with fonts only having an Apple Roman charmap.
author | eugeni |
---|---|
date | Thu, 15 Feb 2007 22:03:09 +0000 |
parents | 0d8005d2fe5c |
children | 1de2a46a0987 |
comparison
equal
deleted
inserted
replaced
22209:5add218bb6c3 | 22210:4a958bd08920 |
---|---|
45 FT_CharMap cmap = face->charmaps[i]; | 45 FT_CharMap cmap = face->charmaps[i]; |
46 unsigned pid = cmap->platform_id; | 46 unsigned pid = cmap->platform_id; |
47 unsigned eid = cmap->encoding_id; | 47 unsigned eid = cmap->encoding_id; |
48 if (pid == 3 /*microsoft*/ && (eid == 1 /*unicode bmp*/ || eid == 10 /*full unicode*/)) { | 48 if (pid == 3 /*microsoft*/ && (eid == 1 /*unicode bmp*/ || eid == 10 /*full unicode*/)) { |
49 FT_Set_Charmap(face, cmap); | 49 FT_Set_Charmap(face, cmap); |
50 break; | 50 return; |
51 } | 51 } |
52 } | |
53 | |
54 if (!face->charmap) { | |
55 if (face->num_charmaps == 0) { | |
56 mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_NoCharmaps); | |
57 return; | |
58 } | |
59 mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_NoCharmapAutodetected); | |
60 FT_Set_Charmap(face, face->charmaps[0]); | |
61 return; | |
52 } | 62 } |
53 } | 63 } |
54 | 64 |
55 /** | 65 /** |
56 * \brief find a memory font by name | 66 * \brief find a memory font by name |