]> granicus.if.org Git - libass/commitdiff
Pass family name as path for memory fonts
authorGrigori Goronzy <greg@chown.ath.cx>
Mon, 22 Aug 2011 04:30:37 +0000 (06:30 +0200)
committerGrigori Goronzy <greg@chown.ath.cx>
Fri, 10 Jul 2015 08:42:40 +0000 (10:42 +0200)
This is a bit nicer because we can actually see which physical font
has been selected for a certain logical font.

libass/ass_font.c
libass/ass_fontselect.c

index ce427814845384f8fdfeb1387e1578a6bf16db8a..1aa8fff4806ec3d60cba63649b06fbac68c10ace 100644 (file)
@@ -145,7 +145,7 @@ static int add_face(ASS_FontSelector *fontsel, ASS_Font *font, uint32_t ch)
                     index, &face);
         if (error) {
             ass_msg(font->library, MSGL_WARN,
-                    "Error opening memory font: '%s'", path);
+                    "Error opening memory font: '%s' (size %d)", path, mem_font.len);
             free(path);
             return -1;
         }
index bb9ec803e41f6c8ff09d9eb282b84c97653e372b..32d4dfa03825742a4fdc24b71588f17f30887da4 100644 (file)
@@ -484,7 +484,7 @@ static char *select_font(ASS_FontSelector *priv, ASS_Library *library,
     if (font_infos[idx].path == NULL) {
         ASS_FontProvider *provider = font_infos[idx].provider;
         face->buf = provider->funcs.get_face(font_infos[idx].priv, &face->len);
-        return strdup("");  // empty string indicates a memory font
+        return strdup(font_infos[idx].family);
     } else
         return strdup(font_infos[idx].path);
 }
@@ -520,7 +520,7 @@ char *ass_font_select(ASS_FontSelector *priv, ASS_Library *library,
         if (res)
             ass_msg(library, MSGL_WARN, "fontselect: Using default "
                     "font family: (%s, %d, %d) -> %s, %d",
-                    family, bold, italic, res[0] ? res : "<memory>", *index);
+                    family, bold, italic, res, *index);
     }
 
     if (!res && priv->path_default) {
@@ -537,13 +537,13 @@ char *ass_font_select(ASS_FontSelector *priv, ASS_Library *library,
         if (res)
             ass_msg(library, MSGL_WARN, "fontselect: Using 'Arial' "
                     "font family: (%s, %d, %d) -> %s, %d", family, bold,
-                    italic, res[0] ? res : "<memory>", *index);
+                    italic, res, *index);
     }
 
     if (res)
         ass_msg(library, MSGL_V,
                 "fontselect: (%s, %d, %d) -> %s, %d", family, bold,
-                italic, res[0] ? res : "<memory>", *index);
+                italic, res, *index);
 
     return res;
 }