just a slightly more robust default font handling... should now work on Haiku even if you didn't install fonts from BeOS.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12347 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2005-04-12 13:15:38 +00:00
parent 8a92263232
commit 6697162d5c
2 changed files with 48 additions and 19 deletions
+12 -10
View File
@@ -91,16 +91,18 @@
// These definitions provide the server something to use for default // These definitions provide the server something to use for default
// system fonts. // system fonts.
#define DEFAULT_PLAIN_FONT_FAMILY "Swis721 BT" # define DEFAULT_PLAIN_FONT_FAMILY "Bitstream Vera Sans"
#define DEFAULT_PLAIN_FONT_STYLE "Roman" # define FALLBACK_PLAIN_FONT_FAMILY "Swis721 BT"
#define DEFAULT_PLAIN_FONT_SIZE 12 # define DEFAULT_PLAIN_FONT_STYLE "Roman"
#define DEFAULT_BOLD_FONT_FAMILY "Swis721 BT" # define DEFAULT_PLAIN_FONT_SIZE 12
#define DEFAULT_BOLD_FONT_STYLE "Bold" # define DEFAULT_BOLD_FONT_FAMILY "Bitstream Vera Sans"
#define DEFAULT_BOLD_FONT_SIZE 12 # define FALLBACK_BOLD_FONT_FAMILY "Swis721 BT"
#define DEFAULT_FIXED_FONT_FAMILY "Courier10 BT" # define DEFAULT_BOLD_FONT_STYLE "Bold"
#define DEFAULT_FIXED_FONT_STYLE "Roman" # define DEFAULT_BOLD_FONT_SIZE 12
#define DEFAULT_FIXED_FONT_SIZE 12 # define DEFAULT_FIXED_FONT_FAMILY "Bitstream Vera Sans Mono"
# define FALLBACK_FIXED_FONT_FAMILY "Courier10 BT"
# define DEFAULT_FIXED_FONT_STYLE "Roman"
# define DEFAULT_FIXED_FONT_SIZE 12
// This is the port capacity for all monitoring objects - ServerApps // This is the port capacity for all monitoring objects - ServerApps
// and ServerWindows // and ServerWindows
#define DEFAULT_MONITOR_PORT_SIZE 30 #define DEFAULT_MONITOR_PORT_SIZE 30
+36 -9
View File
@@ -113,15 +113,42 @@ AppServer::AppServer(void)
// fontserver->ScanDirectory("/boot/home/config/fonts/psfonts/"); // fontserver->ScanDirectory("/boot/home/config/fonts/psfonts/");
fontserver->SaveList(); fontserver->SaveList();
if(!fontserver->SetSystemPlain(DEFAULT_PLAIN_FONT_FAMILY,DEFAULT_PLAIN_FONT_STYLE,DEFAULT_PLAIN_FONT_SIZE)) if(!fontserver->SetSystemPlain(DEFAULT_PLAIN_FONT_FAMILY,
printf("Couldn't set plain to %s, %s %d pt\n",DEFAULT_PLAIN_FONT_FAMILY, DEFAULT_PLAIN_FONT_STYLE,
DEFAULT_PLAIN_FONT_STYLE,DEFAULT_PLAIN_FONT_SIZE); DEFAULT_PLAIN_FONT_SIZE) ||
if(!fontserver->SetSystemBold(DEFAULT_BOLD_FONT_FAMILY,DEFAULT_BOLD_FONT_STYLE,DEFAULT_BOLD_FONT_SIZE)) !fontserver->SetSystemPlain(FALLBACK_PLAIN_FONT_FAMILY,
printf("Couldn't set bold to %s, %s %d pt\n",DEFAULT_BOLD_FONT_FAMILY, DEFAULT_PLAIN_FONT_STYLE,
DEFAULT_BOLD_FONT_STYLE,DEFAULT_BOLD_FONT_SIZE); DEFAULT_PLAIN_FONT_SIZE)) {
if(!fontserver->SetSystemFixed(DEFAULT_FIXED_FONT_FAMILY,DEFAULT_FIXED_FONT_STYLE,DEFAULT_FIXED_FONT_SIZE)) printf("Couldn't set plain to %s, %s %d pt\n",
printf("Couldn't set fixed to %s, %s %d pt\n",DEFAULT_FIXED_FONT_FAMILY, DEFAULT_PLAIN_FONT_FAMILY,
DEFAULT_FIXED_FONT_STYLE,DEFAULT_FIXED_FONT_SIZE); DEFAULT_PLAIN_FONT_STYLE,
DEFAULT_PLAIN_FONT_SIZE);
}
if(!fontserver->SetSystemBold(DEFAULT_BOLD_FONT_FAMILY,
DEFAULT_BOLD_FONT_STYLE,
DEFAULT_BOLD_FONT_SIZE) ||
!fontserver->SetSystemBold(FALLBACK_BOLD_FONT_FAMILY,
DEFAULT_BOLD_FONT_STYLE,
DEFAULT_BOLD_FONT_SIZE)) {
printf("Couldn't set bold to %s, %s %d pt\n",
DEFAULT_BOLD_FONT_FAMILY,
DEFAULT_BOLD_FONT_STYLE,
DEFAULT_BOLD_FONT_SIZE);
}
if(!fontserver->SetSystemFixed(DEFAULT_FIXED_FONT_FAMILY,
DEFAULT_FIXED_FONT_STYLE,
DEFAULT_FIXED_FONT_SIZE) ||
!fontserver->SetSystemFixed(FALLBACK_FIXED_FONT_FAMILY,
DEFAULT_FIXED_FONT_STYLE,
DEFAULT_FIXED_FONT_SIZE)) {
printf("Couldn't set fixed to %s, %s %d pt\n",
DEFAULT_FIXED_FONT_FAMILY,
DEFAULT_FIXED_FONT_STYLE,
DEFAULT_FIXED_FONT_SIZE);
}
fontserver->Unlock(); fontserver->Unlock();