diff --git a/headers/private/servers/app/ServerFont.h b/headers/private/servers/app/ServerFont.h index f79eedce8f..45f192e299 100644 --- a/headers/private/servers/app/ServerFont.h +++ b/headers/private/servers/app/ServerFont.h @@ -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 diff --git a/src/servers/app/ServerApp.cpp b/src/servers/app/ServerApp.cpp index cc466e1b68..84da10d65a 100644 --- a/src/servers/app/ServerApp.cpp +++ b/src/servers/app/ServerApp.cpp @@ -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(font.Size()); } else fLink.StartMessage(status); diff --git a/src/servers/app/ServerFont.cpp b/src/servers/app/ServerFont.cpp index 8511704169..add2712017 100644 --- a/src/servers/app/ServerFont.cpp +++ b/src/servers/app/ServerFont.cpp @@ -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