From 7c9574b1ea91d40b22cb7032553b600b25d62043 Mon Sep 17 00:00:00 2001 From: kojima Date: Mon, 31 May 1999 00:44:18 +0000 Subject: [PATCH] changed WMCreateFont* interface --- WINGs/ChangeLog | 3 +++ WINGs/WINGs.h | 6 ++++-- WINGs/wfont.c | 35 +++++++++++++++++++++++------------ 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/WINGs/ChangeLog b/WINGs/ChangeLog index 512d1ac4..c3c6999d 100644 --- a/WINGs/ChangeLog +++ b/WINGs/ChangeLog @@ -41,6 +41,9 @@ changes since wmaker 0.53.0: wstrdup()'ed copy. DO NOT FREE IT ANYMORE! - added MultiByteText option to userdefaults file to control use of multibyte string drawing functions +- renamed WMCreateFont() to WMCreateFontSet() +- renamed WMCreateFontInDefaultEncoding() to WMCreateNormalFont() +- added WMCreateFont() with different semantics changes since wmaker 0.52.0: diff --git a/WINGs/WINGs.h b/WINGs/WINGs.h index e034308a..a9de8d3c 100644 --- a/WINGs/WINGs.h +++ b/WINGs/WINGs.h @@ -552,9 +552,11 @@ void WMDragImageFromView(WMView *view, WMPixmap *image, WMPoint atLocation, /* ....................................................................... */ -WMFont *WMCreateFont(WMScreen *scrPtr, char *fontName); +WMFont *WMCreateFontSet(WMScreen *scrPtr, char *fontName); -WMFont *WMCreateFontInDefaultEncoding(WMScreen *scrPtr, char *fontName); +WMFont *WMCreateNormalFont(WMScreen *scrPtr, char *fontName); + +WMFont *WMCreateFont(WMScreen *scrPtr, char *fontName); WMFont *WMRetainFont(WMFont *font); diff --git a/WINGs/wfont.c b/WINGs/wfont.c index a2393b48..472080ea 100644 --- a/WINGs/wfont.c +++ b/WINGs/wfont.c @@ -9,7 +9,7 @@ static char *makeFontSetOfSize(char *fontset, int size); WMFont* -WMCreateFont(WMScreen *scrPtr, char *fontName) +WMCreateFontSet(WMScreen *scrPtr, char *fontName) { WMFont *font; Display *display = scrPtr->display; @@ -70,7 +70,7 @@ WMCreateFont(WMScreen *scrPtr, char *fontName) WMFont* -WMCreateFontInDefaultEncoding(WMScreen *scrPtr, char *fontName) +WMCreateNormalFont(WMScreen *scrPtr, char *fontName) { WMFont *font; Display *display = scrPtr->display; @@ -110,6 +110,17 @@ WMCreateFontInDefaultEncoding(WMScreen *scrPtr, char *fontName) +WMFont* +WMCreateFont(WMScreen *scrPtr, char *fontName) +{ + if (WINGsConfiguration.useMultiByte) + return WMCreateFontSet(scrPtr, fontName); + else + return WMCreateNormalFont(scrPtr, fontName); +} + + + WMFont* WMRetainFont(WMFont *font) { @@ -162,20 +173,20 @@ WMSystemFontOfSize(WMScreen *scrPtr, int size) fontSpec = makeFontSetOfSize(WINGsConfiguration.systemFont, size); if (WINGsConfiguration.useMultiByte) - font = WMCreateFont(scrPtr, fontSpec); + font = WMCreateFontSet(scrPtr, fontSpec); else - font = WMCreateFontInDefaultEncoding(scrPtr, fontSpec); + font = WMCreateNormalFont(scrPtr, fontSpec); if (!font) { if (WINGsConfiguration.useMultiByte) { wwarning("could not load font set %s. Trying fixed.", fontSpec); - font = WMCreateFont(scrPtr, "fixed"); + font = WMCreateFontSet(scrPtr, "fixed"); if (!font) { - font = WMCreateFont(scrPtr, "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*"); + font = WMCreateFontSet(scrPtr, "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*"); } } else { wwarning("could not load font %s. Trying fixed.", fontSpec); - font = WMCreateFontInDefaultEncoding(scrPtr, "fixed"); + font = WMCreateNormalFont(scrPtr, "fixed"); } if (!font) { wwarning("could not load fixed font!"); @@ -198,20 +209,20 @@ WMBoldSystemFontOfSize(WMScreen *scrPtr, int size) fontSpec = makeFontSetOfSize(WINGsConfiguration.boldSystemFont, size); if (WINGsConfiguration.useMultiByte) - font = WMCreateFont(scrPtr, fontSpec); + font = WMCreateFontSet(scrPtr, fontSpec); else - font = WMCreateFontInDefaultEncoding(scrPtr, fontSpec); + font = WMCreateNormalFont(scrPtr, fontSpec); if (!font) { if (WINGsConfiguration.useMultiByte) { wwarning("could not load font set %s. Trying fixed.", fontSpec); - font = WMCreateFont(scrPtr, "fixed"); + font = WMCreateFontSet(scrPtr, "fixed"); if (!font) { - font = WMCreateFont(scrPtr, "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*"); + font = WMCreateFontSet(scrPtr, "-*-fixed-medium-r-normal-*-14-*-*-*-*-*-*-*"); } } else { wwarning("could not load font %s. Trying fixed.", fontSpec); - font = WMCreateFontInDefaultEncoding(scrPtr, "fixed"); + font = WMCreateNormalFont(scrPtr, "fixed"); } if (!font) { wwarning("could not load fixed font!");