More fixes to the prefs panel. In fact, for all practical purposes, it should be done.

Added private function _set_system_font_() to not use R5's hack


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13031 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm
2005-06-09 16:08:39 +00:00
parent c7acd48895
commit 4b31e304e7
13 changed files with 480 additions and 572 deletions
+32
View File
@@ -107,6 +107,38 @@ _font_control_(BFont *font, int32 cmd, void *data)
link.Read<uint32>(&font->fFlags);
}
/*!
\brief Private function used to replace the R5 hack which sets a system font
\param which string denoting which font to set
\param family the new family for the system font
\param style the new style for the system font
\param size the size for the system font to have
R5 used a global area offset table to set the system fonts in the Font
preferences panel. Bleah.
*/
void
_set_system_font_(const char *which, font_family family, font_style style,
float size)
{
if(!which)
return;
if( (strcmp(which,"plain")==0) ||
(strcmp(which,"bold")==0) ||
(strcmp(which,"fixed")==0) )
{
BPrivate::BAppServerLink link;
link.StartMessage(AS_SET_SYSTEM_FONT);
link.AttachString(which);
link.AttachString(family);
link.AttachString(style);
link.Attach<float>(size);
link.Flush();
}
}
/*!
\brief Returns the number of installed font families