static void testFontRotation(BView* view, BRect frame) { BFont font; view->GetFont(&font); font.SetRotation(90); view->SetFont(&font, B_FONT_ROTATION); view->DrawString("This is a test!", BPoint(frame.Width() / 2, frame.bottom - 3)); view->GetFont(&font); if (font.Rotation() != 90.0) fprintf(stderr, "Error: Rotation is %f but should be 90.0\n", font.Rotation()); }
// SetFont void Painter::SetFont(const BFont& font) { //fFont.SetFamilyAndStyle(font.GetFamily(), font.GetStyle()); fFont.SetSpacing(font.Spacing()); fFont.SetShear(font.Shear()); fFont.SetRotation(font.Rotation()); fFont.SetSize(font.Size()); _UpdateFont(); }
// constructor Font::Font(const BFont& font) : fFamily("") , fStyle("") , fSize(font.Size()) , fRotation(font.Rotation()) , fShear(font.Shear()) , fFalseBoldWidth(0.0) , fHinting(true) , fKerning(true) , fSpacing(font.Spacing()) , fCachedFontHeightValid(true) { font_family family; font_style style; font.GetFamilyAndStyle(&family, &style); fFamily = family; fStyle = style; font.GetHeight(&fCachedFontHeight); }