summaryrefslogtreecommitdiff
path: root/src/font.c
diff options
context:
space:
mode:
authorMichael Jennings <mej@kainx.org>2002-04-25 02:28:57 +0000
committerMichael Jennings <mej@kainx.org>2002-04-25 02:28:57 +0000
commit498c820020eba2c7bab2a8c654520b900c167991 (patch)
tree658df56ee77dde2e6debb881fd91c7d09ed21ebd /src/font.c
parent306487a72e6f1bd4f512eac83225bb1fc619ae2a (diff)
downloadeterm-498c820020eba2c7bab2a8c654520b900c167991.tar.gz
Wed Apr 24 22:27:51 2002 Michael Jennings (mej)
Save buttonbar info when we save theme settings. SVN revision: 6177
Diffstat (limited to 'src/font.c')
-rw-r--r--src/font.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/font.c b/src/font.c
index e601b06..f505653 100644
--- a/src/font.c
+++ b/src/font.c
@@ -315,6 +315,31 @@ font_cache_find_info(const char *name, unsigned char type) {
return (NULL);
}
+const char *
+get_font_name(void *info)
+{
+ cachefont_t *current;
+
+ REQUIRE_RVAL(info != NULL, NULL);
+
+ D_FONT(("get_font_name(%8p) called.\n", info));
+
+ /* This is also a simple search, but it returns the fontinfo rather than the cache entry. */
+ for (current = font_cache; current; current = current->next) {
+ D_FONT((" -> Checking current (%8p), type == %d, name == %s\n", current, current->type, NONULL(current->name)));
+ if ((current->type == FONT_TYPE_X) && (((void *) current->fontinfo.xfontinfo) == info)) {
+ D_FONT((" -> Match!\n"));
+ return current->name;
+#if UNUSED_BLOCK
+ } else if ((current->type == FONT_TYPE_TTF) && (0)) {
+ } else if ((current->type == FONT_TYPE_FNLIB) && (0)) {
+#endif
+ }
+ }
+ D_FONT(("No matches found. =(\n"));
+ return (NULL);
+}
+
/* load_font() is the function that should be used to allocate fonts. */
void *
load_font(const char *name, const char *fallback, unsigned char type)