Now AS_GET_DEFAULT_SYSTEM_FONT actually returns the default font as used
by the app_server (ie. also if it's a fallback font). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14805 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1147,26 +1147,17 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
// input:
|
// input:
|
||||||
// 1) string - font type ("plain", ...)
|
// 1) string - font type ("plain", ...)
|
||||||
|
|
||||||
const char* family = NULL;
|
ServerFont font;
|
||||||
const char* style = NULL;
|
|
||||||
float size = 0;
|
|
||||||
|
|
||||||
char type[B_OS_NAME_LENGTH];
|
char type[B_OS_NAME_LENGTH];
|
||||||
status_t status = link.ReadString(type, sizeof(type));
|
status_t status = link.ReadString(type, sizeof(type));
|
||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
if (!strcmp(type, "plain")) {
|
if (!strcmp(type, "plain")) {
|
||||||
// TODO: we should return an *existing* font here...
|
font = *gFontManager->DefaultPlainFont();
|
||||||
family = DEFAULT_PLAIN_FONT_FAMILY;
|
|
||||||
style = DEFAULT_PLAIN_FONT_STYLE;
|
|
||||||
size = DEFAULT_PLAIN_FONT_SIZE;
|
|
||||||
} else if (!strcmp(type, "bold")) {
|
} else if (!strcmp(type, "bold")) {
|
||||||
family = DEFAULT_BOLD_FONT_FAMILY;
|
font = *gFontManager->DefaultBoldFont();
|
||||||
style = DEFAULT_BOLD_FONT_STYLE;
|
|
||||||
size = DEFAULT_BOLD_FONT_SIZE;
|
|
||||||
} else if (!strcmp(type, "fixed")) {
|
} else if (!strcmp(type, "fixed")) {
|
||||||
family = DEFAULT_FIXED_FONT_FAMILY;
|
font = *gFontManager->DefaultFixedFont();
|
||||||
style = DEFAULT_FIXED_FONT_STYLE;
|
|
||||||
size = DEFAULT_FIXED_FONT_SIZE;
|
|
||||||
} else
|
} else
|
||||||
status = B_BAD_VALUE;
|
status = B_BAD_VALUE;
|
||||||
}
|
}
|
||||||
@@ -1178,9 +1169,9 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
|
|||||||
// 3) float - size
|
// 3) float - size
|
||||||
|
|
||||||
fLink.StartMessage(B_OK);
|
fLink.StartMessage(B_OK);
|
||||||
fLink.AttachString(family);
|
fLink.AttachString(font.GetFamily());
|
||||||
fLink.AttachString(style);
|
fLink.AttachString(font.GetStyle());
|
||||||
fLink.Attach<float>(size);
|
fLink.Attach<float>(font.Size());
|
||||||
} else
|
} else
|
||||||
fLink.StartMessage(status);
|
fLink.StartMessage(status);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user