diff options
author | Oleg Oshmyan <chortos@inbox.lv> | 2015-10-19 16:11:27 +0300 |
---|---|---|
committer | Oleg Oshmyan <chortos@inbox.lv> | 2015-10-21 21:36:48 +0300 |
commit | ab6aef6d0766aa1ce801c5b4ca1441a491681489 (patch) | |
tree | f169840c7c7f5ebc6186d34a5e306acfb65b1bce /libass/ass_directwrite.c | |
parent | f224c97d4566ca7338cfcd621ce3bd8548372791 (diff) | |
download | libass-ab6aef6d0766aa1ce801c5b4ca1441a491681489.tar.bz2 libass-ab6aef6d0766aa1ce801c5b4ca1441a491681489.tar.xz |
fontselect: move PostScript name into ASS_FontProviderMetaData
Diffstat (limited to 'libass/ass_directwrite.c')
-rw-r--r-- | libass/ass_directwrite.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libass/ass_directwrite.c b/libass/ass_directwrite.c index 521447d..6b6b623 100644 --- a/libass/ass_directwrite.c +++ b/libass/ass_directwrite.c @@ -512,7 +512,6 @@ static void scan_fonts(IDWriteFactory *factory, IDWriteLocalizedStrings *fontNames = NULL; IDWriteLocalizedStrings *psNames = NULL; BOOL exists = FALSE; - char *psName = NULL; hr = IDWriteFontCollection_GetFontFamily(fontCollection, i, &fontFamily); if (FAILED(hr)) @@ -556,8 +555,10 @@ static void scan_fonts(IDWriteFactory *factory, temp_name[NAME_MAX_LENGTH-1] = 0; size_needed = WideCharToMultiByte(CP_UTF8, 0, temp_name, -1, NULL, 0,NULL, NULL); - psName = (char *) malloc(size_needed); - WideCharToMultiByte(CP_UTF8, 0, temp_name, -1, psName, size_needed, NULL, NULL); + char *mbName = (char *) malloc(size_needed); + WideCharToMultiByte(CP_UTF8, 0, temp_name, -1, mbName, size_needed, NULL, NULL); + meta.postscript_name = mbName; + IDWriteLocalizedStrings_Release(psNames); } @@ -618,7 +619,7 @@ static void scan_fonts(IDWriteFactory *factory, FontPrivate *font_priv = (FontPrivate *) calloc(1, sizeof(*font_priv)); font_priv->font = font; - ass_font_provider_add_font(provider, &meta, NULL, 0, psName, font_priv); + ass_font_provider_add_font(provider, &meta, NULL, 0, font_priv); for (UINT32 k = 0; k < meta.n_family; ++k) free(meta.families[k]); @@ -626,7 +627,7 @@ static void scan_fonts(IDWriteFactory *factory, free(meta.fullnames[k]); free(meta.fullnames); free(meta.families); - free(psName); + free(meta.postscript_name); } } } |