bool ServerFont::operator==(const ServerFont& other) const { if (GetFamilyAndStyle() != other.GetFamilyAndStyle()) return false; return fSize == other.fSize && fRotation == other.fRotation && fShear == other.fShear && fFalseBoldWidth == other.fFalseBoldWidth && fFlags == other.fFlags && fSpacing == other.fSpacing && fEncoding == other.fEncoding && fBounds == other.fBounds && fDirection == other.fDirection && fFace == other.fFace; }
void RemoteMessage::AddFont(const ServerFont& font) { Add(font.Direction()); Add((uint8)font.Encoding()); Add(font.Flags()); Add((uint8)font.Spacing()); Add(font.Shear()); Add(font.Rotation()); Add(font.FalseBoldWidth()); Add(font.Size()); Add(font.Face()); Add(font.GetFamilyAndStyle()); }
void CanvasMessage::AddFont(const ServerFont& font) { //TODO:Use TTF/WOFF URL Add(font.Direction()); Add((uint8)font.Encoding()); Add(font.Flags()); Add((uint8)font.Spacing()); Add(font.Shear()); Add(font.Rotation()); Add(font.FalseBoldWidth()); Add(font.Size()); Add(font.Face()); Add(font.GetFamilyAndStyle()); }
/*static*/ void FontCacheEntry::GenerateSignature(char* signature, size_t signatureSize, const ServerFont& font) { glyph_rendering renderingType = _RenderTypeFor(font); // TODO: read more of these from the font FT_Encoding charMap = FT_ENCODING_NONE; bool hinting = font.Hinting(); uint8 averageWeight = gSubpixelAverageWeight; snprintf(signature, signatureSize, "%ld,%u,%d,%d,%.1f,%d,%d", font.GetFamilyAndStyle(), charMap, font.Face(), int(renderingType), font.Size(), hinting, averageWeight); }
//! sets the font to be already scaled by fScale void DrawState::SetFont(const ServerFont& font, uint32 flags) { if (flags == B_FONT_ALL) { fFont = font; fUnscaledFontSize = font.Size(); fFont.SetSize(fUnscaledFontSize * fCombinedScale); } else { // family & style if ((flags & B_FONT_FAMILY_AND_STYLE) != 0) fFont.SetFamilyAndStyle(font.GetFamilyAndStyle()); // size if ((flags & B_FONT_SIZE) != 0) { fUnscaledFontSize = font.Size(); fFont.SetSize(fUnscaledFontSize * fCombinedScale); } // shear if ((flags & B_FONT_SHEAR) != 0) fFont.SetShear(font.Shear()); // rotation if ((flags & B_FONT_ROTATION) != 0) fFont.SetRotation(font.Rotation()); // spacing if ((flags & B_FONT_SPACING) != 0) fFont.SetSpacing(font.Spacing()); // encoding if ((flags & B_FONT_ENCODING) != 0) fFont.SetEncoding(font.Encoding()); // face if ((flags & B_FONT_FACE) != 0) fFont.SetFace(font.Face()); // flags if ((flags & B_FONT_FLAGS) != 0) fFont.SetFlags(font.Flags()); } }