roo_display
API Documentation for roo_display
Loading...
Searching...
No Matches
font.cpp
Go to the documentation of this file.
2
3#include "roo_logging.h"
4#include "roo_io/text/unicode.h"
5
6namespace roo_display {
7
9 Color color) const {
11 char encoded[4];
12 int encoded_len = roo_io::WriteUtf8Char(encoded, code);
14}
15
16roo_logging::Stream& operator<<(roo_logging::Stream& stream,
18 switch (layout) {
20 stream << "FontLayout::kHorizontal";
21 break;
23 stream << "FontLayout::kVertical";
24 break;
25 default:
26 stream << "FontLayout::(unknown)";
27 break;
28 }
29 return stream;
30}
31
32roo_logging::Stream& operator<<(roo_logging::Stream& stream,
34 switch (charset) {
36 stream << "FontProperties::Charset::kAscii";
37 break;
39 stream << "FontProperties::Charset::kUnicodeBmp";
40 break;
41 default:
42 stream << "FontProperties::Charset::(unknown)";
43 break;
44 }
45 return stream;
46}
47
48roo_logging::Stream& operator<<(roo_logging::Stream& stream,
50 switch (spacing) {
52 stream << "FontProperties::Spacing::kProportional";
53 break;
55 stream << "FontProperties::Spacing::kMonospace";
56 break;
57 default:
58 stream << "FontProperties::Spacing::(unknown)";
59 break;
60 }
61 return stream;
62}
63
64roo_logging::Stream& operator<<(roo_logging::Stream& stream,
65 FontProperties::Smoothing smoothing) {
66 switch (smoothing) {
68 stream << "FontProperties::Smoothing::kNone";
69 break;
71 stream << "FontProperties::Smoothing::kGrayscale";
72 break;
73 default:
74 stream << "FontProperties::Smoothing::(unknown)";
75 break;
76 }
77 return stream;
78}
79
80roo_logging::Stream& operator<<(roo_logging::Stream& stream,
82 switch (kerning) {
84 stream << "FontProperties::Kerning::kNone";
85 break;
87 stream << "FontProperties::Kerning::kPairs";
88 break;
89 default:
90 stream << "FontProperties::Kerning::(unknown)";
91 break;
92 }
93 return stream;
94}
95
96} // namespace roo_display
ARGB8888 color stored as a 32-bit unsigned integer.
Definition color.h:16
Smoothing
Smoothing/anti-aliasing mode.
Definition font.h:85
Spacing
Spacing behavior for glyph advances.
Definition font.h:82
Charset
Character set supported by the font.
Definition font.h:76
Kerning
Kerning information availability.
Definition font.h:88
void drawHorizontalString(const Surface &s, roo::string_view text, Color color) const
Draw a UTF-8 string horizontally using a string view.
Definition font.h:209
virtual void drawGlyph(const Surface &s, char32_t code, FontLayout layout, Color color) const
Draw a single glyph.
Definition font.cpp:8
Low-level handle used to draw to an underlying device.
Definition drawable.h:60
Defines 140 opaque HTML named colors.
FontLayout
Glyph layout direction.
Definition font.h:16
roo_logging::Stream & operator<<(roo_logging::Stream &os, BlendingMode mode)
Definition blending.cpp:54