Also set the font properties for BPictures. Some of them, at least.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21938 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -805,6 +805,76 @@ ServerPicture::SyncState(ViewLayer *view)
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
ServerPicture::SetFontFromLink(BPrivate::LinkReceiver& link)
|
||||
{
|
||||
BeginOp(B_PIC_ENTER_STATE_CHANGE);
|
||||
|
||||
uint16 mask;
|
||||
link.Read<uint16>(&mask);
|
||||
|
||||
if (mask & B_FONT_FAMILY_AND_STYLE) {
|
||||
uint32 fontID;
|
||||
link.Read<uint32>(&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<float>(&size);
|
||||
WriteSetFontSize(size);
|
||||
}
|
||||
|
||||
if (mask & B_FONT_SHEAR) {
|
||||
float shear;
|
||||
link.Read<float>(&shear);
|
||||
WriteSetFontShear(shear);
|
||||
}
|
||||
|
||||
if (mask & B_FONT_ROTATION) {
|
||||
float rotation;
|
||||
link.Read<float>(&rotation);
|
||||
WriteSetFontRotation(rotation);
|
||||
}
|
||||
|
||||
if (mask & B_FONT_FALSE_BOLD_WIDTH) {
|
||||
float falseBoldWidth;
|
||||
link.Read<float>(&falseBoldWidth);
|
||||
//SetFalseBoldWidth(falseBoldWidth);
|
||||
}
|
||||
|
||||
if (mask & B_FONT_SPACING) {
|
||||
uint8 spacing;
|
||||
link.Read<uint8>(&spacing);
|
||||
WriteSetFontSpacing(spacing);
|
||||
}
|
||||
|
||||
if (mask & B_FONT_ENCODING) {
|
||||
uint8 encoding;
|
||||
link.Read<uint8>((uint8*)&encoding);
|
||||
WriteSetFontEncoding(encoding);
|
||||
}
|
||||
|
||||
if (mask & B_FONT_FACE) {
|
||||
uint16 face;
|
||||
link.Read<uint16>(&face);
|
||||
WriteSetFontFace(face);
|
||||
}
|
||||
|
||||
if (mask & B_FONT_FLAGS) {
|
||||
uint32 flags;
|
||||
link.Read<uint32>(&flags);
|
||||
WriteSetFontFlags(flags);
|
||||
}
|
||||
|
||||
EndOp();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ServerPicture::Play(ViewLayer *view)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user