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:
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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!");
|
||||
|
||||
Reference in New Issue
Block a user