* ServerFont now also adopts the FontStyle's face and direction on

construction.
* ServerFont::SetStyle() now adopts the style's face and direction, too.
* Started a more sane handling of ServerFont::SetFace() (at least there's
  a to-do comment :-)).
* Minor cleanup (GetStyle() -> Style(), GetFamily() -> Family(),
  GetPath() -> Path()).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14809 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-11-09 20:10:40 +00:00
parent 4e7d1d4b6a
commit 90dfa70739
3 changed files with 29 additions and 21 deletions
+12 -15
View File
@@ -56,12 +56,11 @@ class ServerFont {
{ return fStyle->GlyphCount(); }
int32 CountTuned();
font_file_format FileFormat();
const char* GetStyle() const;
const char* GetFamily() const;
const char* GetPath() const
const char* Style() const;
const char* Family() const;
const char* Path() const
{ return fStyle->Path(); }
void SetStyle(FontStyle& style);
@@ -75,26 +74,24 @@ class ServerFont {
{ return fStyle->Family()->ID(); }
uint32 GetFamilyAndStyle() const;
void SetDirection(const font_direction& dir)
void SetDirection(font_direction dir)
{ fDirection = dir; }
void SetEdges(const edge_info& info)
void SetEdges(edge_info info)
{ fEdges = info; }
void SetEncoding(uint32 encoding)
{ fEncoding = encoding; }
void SetFlags(const uint32& value)
void SetFlags(uint32 value)
{ fFlags = value; }
void SetSpacing(const uint32& value)
void SetSpacing(uint32 value)
{ fSpacing = value; }
void SetShear(const float& value)
void SetShear(float value)
{ fShear = value; }
void SetSize(const float& value)
void SetSize(float value)
{ fSize = value; }
void SetRotation(const float& value)
void SetRotation(float value)
{ fRotation = value; }
void SetFace(const uint32& value)
{ fFace = value; }
void SetFace(uint32 face);
bool IsFixedWidth() const
{ return fStyle->IsFixedWidth(); }
bool IsScalable() const
+2 -2
View File
@@ -1169,8 +1169,8 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
// 3) float - size
fLink.StartMessage(B_OK);
fLink.AttachString(font.GetFamily());
fLink.AttachString(font.GetStyle());
fLink.AttachString(font.Family());
fLink.AttachString(font.Style());
fLink.Attach<float>(font.Size());
} else
fLink.StartMessage(status);
+15 -4
View File
@@ -135,8 +135,8 @@ ServerFont::ServerFont(FontStyle& style, float size,
fBounds(0, 0, 0, 0),
fFlags(flags),
fSpacing(spacing),
fDirection(B_FONT_LEFT_TO_RIGHT),
fFace(B_REGULAR_FACE),
fDirection(style.Direction()),
fFace(style.Face()),
fEncoding(B_UNICODE_UTF8)
{
fStyle->Acquire();
@@ -218,14 +218,14 @@ ServerFont::FileFormat()
const char*
ServerFont::GetStyle() const
ServerFont::Style() const
{
return fStyle->Name();
}
const char*
ServerFont::GetFamily() const
ServerFont::Family() const
{
return fStyle->Family()->Name();
}
@@ -241,6 +241,9 @@ ServerFont::SetStyle(FontStyle& style)
// attach to new style
fStyle = &style;
fFace = style.Face();
fDirection = style.Direction();
fStyle->Acquire();
}
}
@@ -290,6 +293,14 @@ ServerFont::SetFamilyAndStyle(uint32 fontID)
}
void
ServerFont::SetFace(uint32 face)
{
// TODO: change font style as requested!
fFace = face;
}
/*!
\brief Gets the ID values for the ServerFont instance in one shot
\return the combination of family and style ID numbers