diff --git a/src/servers/app/ServerPicture.cpp b/src/servers/app/ServerPicture.cpp index c986e25297..23b9839b7b 100644 --- a/src/servers/app/ServerPicture.cpp +++ b/src/servers/app/ServerPicture.cpp @@ -805,6 +805,76 @@ ServerPicture::SyncState(ViewLayer *view) } +void +ServerPicture::SetFontFromLink(BPrivate::LinkReceiver& link) +{ + BeginOp(B_PIC_ENTER_STATE_CHANGE); + + uint16 mask; + link.Read(&mask); + + if (mask & B_FONT_FAMILY_AND_STYLE) { + uint32 fontID; + link.Read(&fontID); + //uint16 style = fontID & 0xFFFF; + //uint16 family = (fontID & 0xFFFF0000) >> 16; + // TODO: WriteSetFamily() and WriteSetStyle() + // accept font_family and font_style parameters, not uint16 + //WriteSetFontFamily(family); + //WriteSetFontStyle(style); + } + + if (mask & B_FONT_SIZE) { + float size; + link.Read(&size); + WriteSetFontSize(size); + } + + if (mask & B_FONT_SHEAR) { + float shear; + link.Read(&shear); + WriteSetFontShear(shear); + } + + if (mask & B_FONT_ROTATION) { + float rotation; + link.Read(&rotation); + WriteSetFontRotation(rotation); + } + + if (mask & B_FONT_FALSE_BOLD_WIDTH) { + float falseBoldWidth; + link.Read(&falseBoldWidth); + //SetFalseBoldWidth(falseBoldWidth); + } + + if (mask & B_FONT_SPACING) { + uint8 spacing; + link.Read(&spacing); + WriteSetFontSpacing(spacing); + } + + if (mask & B_FONT_ENCODING) { + uint8 encoding; + link.Read((uint8*)&encoding); + WriteSetFontEncoding(encoding); + } + + if (mask & B_FONT_FACE) { + uint16 face; + link.Read(&face); + WriteSetFontFace(face); + } + + if (mask & B_FONT_FLAGS) { + uint32 flags; + link.Read(&flags); + WriteSetFontFlags(flags); + } + + EndOp(); +} + void ServerPicture::Play(ViewLayer *view) diff --git a/src/servers/app/ServerPicture.h b/src/servers/app/ServerPicture.h index 02958fa648..2fe993de9e 100644 --- a/src/servers/app/ServerPicture.h +++ b/src/servers/app/ServerPicture.h @@ -23,7 +23,9 @@ public: void EnterFontChange(); void ExitFontChange(); - void SyncState(ViewLayer *view); + void SyncState(ViewLayer *view); + void SetFontFromLink(BPrivate::LinkReceiver& link); + void Play(ViewLayer *view); void Usurp(ServerPicture *newPicture); diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index 195391b3d3..fefe0716c0 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -2445,6 +2445,12 @@ ServerWindow::_DispatchPictureMessage(int32 code, BPrivate::LinkReceiver &link) break; } + case AS_LAYER_SET_FONT_STATE: + { + picture->SetFontFromLink(link); + break; + } + case AS_FILL_RECT: case AS_STROKE_RECT: {