2 * Copyright 2014 Stephan Aßmus <superstippi@gmx.de>
3 * All rights reserved. Distributed under the terms of the MIT license.
11 #include <Application.h>
13 #include <GradientLinear.h>
16 #include <LayoutBuilder.h>
18 #include <PopUpMenu.h>
19 #include <Resources.h>
21 #include <ScrollView.h>
23 #include <StringView.h>
28 static const char* kAppSignature
= "application/x.vnd-Haiku.FontSpacing";
31 class TestView
: public BView
{
36 virtual void Draw(BRect updateRect
);
42 BView(NULL
, B_WILL_DRAW
| B_FULL_UPDATE_ON_RESIZE
)
53 TestView::Draw(BRect updateRect
)
55 float scale
= Bounds().Width() / 400.0f
;
59 else if (scale
> 3.0f
)
64 const char* string
= "Testing the various BFont spacing modes.";
68 DrawString(string
, BPoint(30.0f
, 25.0f
));
70 font
.SetSpacing(B_STRING_SPACING
);
72 DrawString(string
, BPoint(30.0f
, 45.0f
));
74 font
.SetSpacing(B_CHAR_SPACING
);
76 DrawString(string
, BPoint(30.0f
, 65.0f
));
84 main(int argc
, char** argv
)
86 BApplication
app(kAppSignature
);
88 BWindow
* window
= new BWindow(BRect(50, 50, 450, 450), "Font spacing test",
89 B_TITLED_WINDOW
, B_NOT_ZOOMABLE
| B_QUIT_ON_WINDOW_CLOSE
90 | B_AUTO_UPDATE_SIZE_LIMITS
);
92 BLayoutBuilder::Group
<>(window
)