1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 01:52:19 +00:00

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.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22228 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
eugeni 2007-02-15 22:03:09 +00:00
parent 520db0d850
commit 1400b0f436
2 changed files with 13 additions and 1 deletions

View File

@ -2049,3 +2049,5 @@ static char help_text[]=
#define MSGTR_LIBASS_GlyphNotFoundReselectingFont "[ass] Glyph 0x%X not found, reselecting font for (%s, %d, %d)\n"
#define MSGTR_LIBASS_GlyphNotFound "[ass] Glyph 0x%X not found in font for (%s, %d, %d)\n"
#define MSGTR_LIBASS_ErrorOpeningMemoryFont "[ass] Error opening memory font: %s\n"
#define MSGTR_LIBASS_NoCharmaps "[ass] font face with no charmaps\n"
#define MSGTR_LIBASS_NoCharmapAutodetected "[ass] no charmap autodetected, trying the first one\n"

View File

@ -47,9 +47,19 @@ static void charmap_magic(FT_Face face)
unsigned eid = cmap->encoding_id;
if (pid == 3 /*microsoft*/ && (eid == 1 /*unicode bmp*/ || eid == 10 /*full unicode*/)) {
FT_Set_Charmap(face, cmap);
break;
return;
}
}
if (!face->charmap) {
if (face->num_charmaps == 0) {
mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_NoCharmaps);
return;
}
mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_NoCharmapAutodetected);
FT_Set_Charmap(face, face->charmaps[0]);
return;
}
}
/**