summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@chown.ath.cx>2011-08-22 06:30:37 +0200
committerGrigori Goronzy <greg@chown.ath.cx>2015-07-10 10:42:40 +0200
commit4f2309430ae2f8086e2b46a45fd4f264a2e0a668 (patch)
tree9d8ae2844f6a00be856e87dd560e1a7eee7a87ea
parent4803b0a7bc9fee78e9eafb7417fa20f9a21d675f (diff)
downloadlibass-4f2309430ae2f8086e2b46a45fd4f264a2e0a668.tar.bz2
libass-4f2309430ae2f8086e2b46a45fd4f264a2e0a668.tar.xz
Pass family name as path for memory fonts
This is a bit nicer because we can actually see which physical font has been selected for a certain logical font.
-rw-r--r--libass/ass_font.c2
-rw-r--r--libass/ass_fontselect.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/libass/ass_font.c b/libass/ass_font.c
index ce42781..1aa8fff 100644
--- a/libass/ass_font.c
+++ b/libass/ass_font.c
@@ -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;
}
diff --git a/libass/ass_fontselect.c b/libass/ass_fontselect.c
index bb9ec80..32d4dfa 100644
--- a/libass/ass_fontselect.c
+++ b/libass/ass_fontselect.c
@@ -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;
}