4#include "TGLIncludes.h"
10#include "TGLSdfFontMakerLowLevel.icxx"
29 int buflen = 10 +
objlen + 8;
97 printf(
"TGLSdfFontMaker::MakeFont entering.\n");
99 const std::string base =
"31:126";
100 const std::string
accented =
",0x00e0:0x00fc,0x010c:0x010d,0x0160:0x0161,0x017d:0x017e";
101 const std::string
greek =
",0x0391:0x03a9,0x03b1:0x03c9";
104 root_sdf_fonts::SdfCreator
sc;
107 std::unique_ptr<TGLWidget>
glw(
117 std::cerr <<
"Input file not specified" << std::endl;
123 if (
ext_dot == std::string::npos) {
130 if (!
sc.font.load_ttf_file(
filename.c_str())) {
131 std::cerr <<
"Error reading TTF file '" <<
filename <<
"' " << std::endl;
137 sc.sdf_atlas.init(&
sc.font,
sc.width,
sc.row_height,
sc.border_size);
140 sc.apply_unicode_ranges();
142 sc.sdf_atlas.draw_glyphs(
sc.gp);
145 std::cout <<
"Allocated " <<
sc.sdf_atlas.glyph_count <<
" glyphs\n";
146 std::cout <<
"Atlas maximum height is " <<
sc.sdf_atlas.max_height <<
"\n";
149 if (
sc.height == 0) {
150 sc.height =
sc.sdf_atlas.max_height;
176 std::cerr <<
"Error creating framebuffer!" << std::endl;
188 sc.sdf_gl.render_sdf({float(
sc.width), float(
sc.height)},
sc.gp.fp.vertices,
sc.gp.lp.vertices);
196 printf(
"Resulting GL buffer: w=%d, h=%d\n",
sc.width,
sc.height);
199 pw.ref_row_pointers().resize(
sc.height);
200 for (
int iy = 0; iy <
sc.height; ++iy) {
201 pw.ref_row_pointers()[
sc.height - iy - 1] =
picbuf + iy *
sc.width;
210 std::string
json =
sc.sdf_atlas.json(
sc.height);
217 perror(
"Error writing json file.");
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
C++ wrapper over simple writer of PNG files for standard GL memory formats: LUMINANCE,...
static int MakeFont(const char *ttf_font, const char *output_prefix, bool verbose=false)
Converts TTF font 'ttf_font' into a SDF font texture atlas (png format) and a compressed font metrics...