1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 14:08:06 +01:00

changed WMCreateFont* interface

This commit is contained in:
kojima
1999-05-31 00:44:18 +00:00
parent 2bff75f4f7
commit 7c9574b1ea
3 changed files with 30 additions and 14 deletions

View File

@@ -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:

View File

@@ -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);

View File

@@ -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!");