├── Makefile ├── README.md ├── ex-sdl-freetype-harfbuzz.c ├── fonts ├── DejaVuSerif.ttf ├── README.txt ├── amiri-0.104 │ ├── OFL.txt │ ├── README.txt │ └── amiri-regular.ttf ├── fireflysung-1.3.0 │ ├── AUTHORS │ ├── COPYRIGHT │ ├── Changelog │ ├── Changelog.big5 │ ├── fireflysung.ttf │ └── license │ │ ├── big5 │ │ └── ARPHICPL.TXT │ │ ├── english │ │ └── ARPHICPL.TXT │ │ └── gb │ │ └── ARPHICPL.TXT └── lateef.ttf └── screenshot.png /Makefile: -------------------------------------------------------------------------------- 1 | # make PREFIX=/some/where if you've got custom HarfBuzz installed somewhere 2 | 3 | PREFIX?=/usr 4 | export PKG_CONFIG_PATH:=$(PREFIX)/lib/pkgconfig 5 | CC=gcc 6 | CFLAGS=--std=c99 -ggdb3 -Wall -Wextra -pedantic \ 7 | `pkg-config sdl --cflags` \ 8 | `pkg-config freetype2 --cflags` \ 9 | `pkg-config harfbuzz --cflags` 10 | LIBS=\ 11 | `pkg-config sdl --libs` \ 12 | `pkg-config freetype2 --libs` \ 13 | `pkg-config harfbuzz --libs` 14 | 15 | # so as not to have to use LD_LIBRARY_PATH when prefix is custom 16 | LDFLAGS=-Wl,-rpath -Wl,$(PREFIX)/lib 17 | 18 | all: ex-sdl-freetype-harfbuzz 19 | 20 | ex-sdl-freetype-harfbuzz: ex-sdl-freetype-harfbuzz.c 21 | $(CC) $< $(CFLAGS) -o $@ $(LDFLAGS) $(LIBS) 22 | 23 | clean: 24 | rm -f ex-sdl-freetype-harfbuzz 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is a simplish sample application to get from zero to rendering unicode 2 | text using harfbuzz to do the text layout, freetype for the underlying font 3 | magic, some trivial code for the anti-aliased font rasterization, and the SDL 4 | to create the window to display stuff in. 5 | 6 | Based on and forked from https://github.com/anoek/ex-sdl-cairo-freetype-harfbuzz/ 7 | 8 | Many thanks. 9 | 10 | Screenshot 11 | ========== 12 | 13 | ![Screenshot](https://github.com/lxnt/ex-sdl-freetype-harfbuzz/raw/master/screenshot.png) 14 | -------------------------------------------------------------------------------- /ex-sdl-freetype-harfbuzz.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #include 8 | #include FT_FREETYPE_H 9 | #include FT_GLYPH_H 10 | #include FT_OUTLINE_H 11 | 12 | #include 13 | #include 14 | 15 | #define NUM_EXAMPLES 3 16 | 17 | /* tranlations courtesy of google */ 18 | const char *texts[NUM_EXAMPLES] = { 19 | "Ленивый рыжий кот", 20 | "كسول الزنجبيل القط", 21 | "懶惰的姜貓", 22 | }; 23 | 24 | const int text_directions[NUM_EXAMPLES] = { 25 | HB_DIRECTION_LTR, 26 | HB_DIRECTION_RTL, 27 | HB_DIRECTION_TTB, 28 | }; 29 | 30 | /* XXX: These are not correct, though it doesn't seem to break anything 31 | * regardless of their value. */ 32 | const char *languages[NUM_EXAMPLES] = { 33 | "en", 34 | "ar", 35 | "ch", 36 | }; 37 | 38 | const hb_script_t scripts[NUM_EXAMPLES] = { 39 | HB_SCRIPT_LATIN, 40 | HB_SCRIPT_ARABIC, 41 | HB_SCRIPT_HAN, 42 | }; 43 | 44 | enum { 45 | ENGLISH=0, ARABIC, CHINESE 46 | }; 47 | 48 | typedef struct _spanner_baton_t { 49 | /* rendering part - assumes 32bpp surface */ 50 | uint32_t *pixels; // set to the glyph's origin. 51 | uint32_t *first_pixel, *last_pixel; // bounds check 52 | uint32_t pitch; 53 | uint32_t rshift; 54 | uint32_t gshift; 55 | uint32_t bshift; 56 | uint32_t ashift; 57 | 58 | /* sizing part */ 59 | int min_span_x; 60 | int max_span_x; 61 | int min_y; 62 | int max_y; 63 | } spanner_baton_t; 64 | 65 | /* google this */ 66 | #ifndef unlikely 67 | #define unlikely 68 | #endif 69 | 70 | /* This spanner is write only, suitable for write-only mapped buffers, 71 | but can cause dark streaks where glyphs overlap, like in arabic scripts. 72 | 73 | Note how spanners don't clip against surface width - resize the window 74 | and see what it leads to. */ 75 | void spanner_wo(int y, int count, const FT_Span* spans, void *user) { 76 | spanner_baton_t *baton = (spanner_baton_t *) user; 77 | uint32_t *scanline = baton->pixels - y * ( (int) baton->pitch / 4 ); 78 | if (unlikely scanline < baton->first_pixel) 79 | return; 80 | for (int i = 0; i < count; i++) { 81 | uint32_t color = 82 | ((spans[i].coverage/2) << baton->rshift) | 83 | ((spans[i].coverage/2) << baton->gshift) | 84 | ((spans[i].coverage/2) << baton->bshift); 85 | 86 | uint32_t *start = scanline + spans[i].x; 87 | if (unlikely start + spans[i].len > baton->last_pixel) 88 | return; 89 | 90 | for (int x = 0; x < spans[i].len; x++) 91 | *start++ = color; 92 | } 93 | } 94 | 95 | /* This spanner does read/modify/write, trading performance for accuracy. 96 | The color here is simply half coverage value in all channels, 97 | effectively mid-gray. 98 | Suitable for when artifacts mostly do come up and annoy. 99 | This might be optimized if one does rmw only for some values of x. 100 | But since the whole buffer has to be rw anyway, and the previous value 101 | is probably still in the cache, there's little point to. */ 102 | void spanner_rw(int y, int count, const FT_Span* spans, void *user) { 103 | spanner_baton_t *baton = (spanner_baton_t *) user; 104 | uint32_t *scanline = baton->pixels - y * ( (int) baton->pitch / 4 ); 105 | if (unlikely scanline < baton->first_pixel) 106 | return; 107 | 108 | for (int i = 0; i < count; i++) { 109 | uint32_t color = 110 | ((spans[i].coverage/2) << baton->rshift) | 111 | ((spans[i].coverage/2) << baton->gshift) | 112 | ((spans[i].coverage/2) << baton->bshift); 113 | uint32_t *start = scanline + spans[i].x; 114 | if (unlikely start + spans[i].len > baton->last_pixel) 115 | return; 116 | 117 | for (int x = 0; x < spans[i].len; x++) 118 | *start++ |= color; 119 | } 120 | } 121 | 122 | /* This spanner is for obtaining exact bounding box for the string. 123 | Unfortunately this can't be done without rendering it (or pretending to). 124 | After this runs, we get min and max values of coordinates used. 125 | */ 126 | void spanner_sizer(int y, int count, const FT_Span* spans, void *user) { 127 | spanner_baton_t *baton = (spanner_baton_t *) user; 128 | 129 | if (y < baton->min_y) 130 | baton->min_y = y; 131 | if (y > baton->max_y) 132 | baton->max_y = y; 133 | for (int i = 0 ; i < count; i++) { 134 | if (spans[i].x + spans[i].len > baton->max_span_x) 135 | baton->max_span_x = spans[i].x + spans[i].len; 136 | if (spans[i].x < baton->min_span_x) 137 | baton->min_span_x = spans[i].x; 138 | } 139 | } 140 | 141 | FT_SpanFunc spanner = spanner_wo; 142 | 143 | void ftfdump(FT_Face ftf) { 144 | for(int i=0; inum_charmaps; i++) { 145 | printf("%d: %s %s %c%c%c%c plat=%hu id=%hu\n", i, 146 | ftf->family_name, 147 | ftf->style_name, 148 | ftf->charmaps[i]->encoding >>24, 149 | (ftf->charmaps[i]->encoding >>16 ) & 0xff, 150 | (ftf->charmaps[i]->encoding >>8) & 0xff, 151 | (ftf->charmaps[i]->encoding) & 0xff, 152 | ftf->charmaps[i]->platform_id, 153 | ftf->charmaps[i]->encoding_id 154 | ); 155 | } 156 | } 157 | 158 | /* See http://www.microsoft.com/typography/otspec/name.htm 159 | for a list of some possible platform-encoding pairs. 160 | We're interested in 0-3 aka 3-1 - UCS-2. 161 | Otherwise, fail. If a font has some unicode map, but lacks 162 | UCS-2 - it is a broken or irrelevant font. What exactly 163 | Freetype will select on face load (it promises most wide 164 | unicode, and if that will be slower that UCS-2 - left as 165 | an excercise to check. */ 166 | int force_ucs2_charmap(FT_Face ftf) { 167 | for(int i = 0; i < ftf->num_charmaps; i++) 168 | if (( (ftf->charmaps[i]->platform_id == 0) 169 | && (ftf->charmaps[i]->encoding_id == 3)) 170 | || ((ftf->charmaps[i]->platform_id == 3) 171 | && (ftf->charmaps[i]->encoding_id == 1))) 172 | return FT_Set_Charmap(ftf, ftf->charmaps[i]); 173 | return -1; 174 | } 175 | 176 | void hline(SDL_Surface *s, int min_x, int max_x, int y, uint32_t color) { 177 | uint32_t *pix = (uint32_t *)s->pixels + (y * s->pitch) / 4 + min_x; 178 | uint32_t *end = (uint32_t *)s->pixels + (y * s->pitch) / 4 + max_x; 179 | 180 | while (pix - 1 != end) 181 | *pix++ = color; 182 | } 183 | 184 | void vline(SDL_Surface *s, int min_y, int max_y, int x, uint32_t color) { 185 | uint32_t *pix = (uint32_t *)s->pixels + (min_y * s->pitch) / 4 + x; 186 | uint32_t *end = (uint32_t *)s->pixels + (max_y * s->pitch) / 4 + x; 187 | 188 | while (pix - s->pitch/4 != end) { 189 | *pix = color; 190 | pix += s->pitch/4; 191 | } 192 | } 193 | 194 | int main () { 195 | int ptSize = 50*64; 196 | int device_hdpi = 72; 197 | int device_vdpi = 72; 198 | 199 | /* Init freetype */ 200 | FT_Library ft_library; 201 | assert(!FT_Init_FreeType(&ft_library)); 202 | 203 | /* Load our fonts */ 204 | FT_Face ft_face[NUM_EXAMPLES]; 205 | assert(!FT_New_Face(ft_library, "fonts/DejaVuSerif.ttf", 0, &ft_face[ENGLISH])); 206 | assert(!FT_Set_Char_Size(ft_face[ENGLISH], 0, ptSize, device_hdpi, device_vdpi )); 207 | ftfdump(ft_face[ENGLISH]); // wonderful world of encodings ... 208 | force_ucs2_charmap(ft_face[ENGLISH]); // which we ignore. 209 | 210 | assert(!FT_New_Face(ft_library, "fonts/amiri-0.104/amiri-regular.ttf", 0, &ft_face[ARABIC])); 211 | assert(!FT_Set_Char_Size(ft_face[ARABIC], 0, ptSize, device_hdpi, device_vdpi )); 212 | ftfdump(ft_face[ARABIC]); 213 | force_ucs2_charmap(ft_face[ARABIC]); 214 | 215 | assert(!FT_New_Face(ft_library, "fonts/fireflysung-1.3.0/fireflysung.ttf", 0, &ft_face[CHINESE])); 216 | assert(!FT_Set_Char_Size(ft_face[CHINESE], 0, ptSize, device_hdpi, device_vdpi )); 217 | ftfdump(ft_face[CHINESE]); 218 | force_ucs2_charmap(ft_face[CHINESE]); 219 | 220 | /* Get our harfbuzz font structs */ 221 | hb_font_t *hb_ft_font[NUM_EXAMPLES]; 222 | hb_ft_font[ENGLISH] = hb_ft_font_create(ft_face[ENGLISH], NULL); 223 | hb_ft_font[ARABIC] = hb_ft_font_create(ft_face[ARABIC] , NULL); 224 | hb_ft_font[CHINESE] = hb_ft_font_create(ft_face[CHINESE], NULL); 225 | 226 | /** Setup our SDL window **/ 227 | int width = 800; 228 | int height = 600; 229 | int videoFlags = SDL_SWSURFACE | SDL_RESIZABLE | SDL_DOUBLEBUF; 230 | int bpp = 32; 231 | 232 | /* Initialize our SDL window */ 233 | if(SDL_Init(SDL_INIT_VIDEO) < 0) { 234 | fprintf(stderr, "Failed to initialize SDL"); 235 | return -1; 236 | } 237 | 238 | SDL_WM_SetCaption("\"Simple\" SDL+FreeType+HarfBuzz Example", "\"Simple\" SDL+FreeType+HarfBuzz Example"); 239 | 240 | SDL_Surface *screen; 241 | screen = SDL_SetVideoMode(width, height, bpp, videoFlags); 242 | 243 | /* Enable key repeat, just makes it so we don't have to worry about fancy 244 | * scanboard keyboard input and such */ 245 | SDL_EnableKeyRepeat(300, 130); 246 | SDL_EnableUNICODE(1); 247 | 248 | /* Create an SDL image surface we can draw to */ 249 | SDL_Surface *sdl_surface = SDL_CreateRGBSurface (0, width, height, 32, 0,0,0,0); 250 | 251 | /* Create a buffer for harfbuzz to use */ 252 | hb_buffer_t *buf = hb_buffer_create(); 253 | 254 | /* Our main event/draw loop */ 255 | int done = 0; 256 | int resized = 1; 257 | while (!done) { 258 | /* Clear our surface */ 259 | SDL_FillRect( sdl_surface, NULL, 0 ); 260 | SDL_LockSurface(sdl_surface); 261 | 262 | for (int i=0; i < NUM_EXAMPLES; ++i) { 263 | hb_buffer_set_direction(buf, text_directions[i]); /* or LTR */ 264 | hb_buffer_set_script(buf, scripts[i]); /* see hb-unicode.h */ 265 | hb_buffer_set_language(buf, hb_language_from_string(languages[i], strlen(languages[i]))); 266 | 267 | /* Layout the text */ 268 | hb_buffer_add_utf8(buf, texts[i], strlen(texts[i]), 0, strlen(texts[i])); 269 | hb_shape(hb_ft_font[i], buf, NULL, 0); 270 | 271 | unsigned int glyph_count; 272 | hb_glyph_info_t *glyph_info = hb_buffer_get_glyph_infos(buf, &glyph_count); 273 | hb_glyph_position_t *glyph_pos = hb_buffer_get_glyph_positions(buf, &glyph_count); 274 | 275 | /* set up rendering via spanners */ 276 | spanner_baton_t stuffbaton; 277 | 278 | FT_Raster_Params ftr_params; 279 | ftr_params.target = 0; 280 | ftr_params.flags = FT_RASTER_FLAG_DIRECT | FT_RASTER_FLAG_AA; 281 | ftr_params.user = &stuffbaton; 282 | ftr_params.black_spans = 0; 283 | ftr_params.bit_set = 0; 284 | ftr_params.bit_test = 0; 285 | 286 | /* Calculate string bounding box in pixels */ 287 | ftr_params.gray_spans = spanner_sizer; 288 | 289 | /* See http://www.freetype.org/freetype2/docs/glyphs/glyphs-3.html */ 290 | 291 | int max_x = INT_MIN; // largest coordinate a pixel has been set at, or the pen was advanced to. 292 | int min_x = INT_MAX; // smallest coordinate a pixel has been set at, or the pen was advanced to. 293 | int max_y = INT_MIN; // this is max topside bearing along the string. 294 | int min_y = INT_MAX; // this is max value of (height - topbearing) along the string. 295 | /* Naturally, the above comments swap their meaning between horizontal and vertical scripts, 296 | since the pen changes the axis it is advanced along. 297 | However, their differences still make up the bounding box for the string. 298 | Also note that all this is in FT coordinate system where y axis points upwards. 299 | */ 300 | 301 | int sizer_x = 0; 302 | int sizer_y = 0; /* in FT coordinate system. */ 303 | 304 | FT_Error fterr; 305 | for (unsigned j = 0; j < glyph_count; ++j) { 306 | if ((fterr = FT_Load_Glyph(ft_face[i], glyph_info[j].codepoint, 0))) { 307 | printf("load %08x failed fterr=%d.\n", glyph_info[j].codepoint, fterr); 308 | } else { 309 | if (ft_face[i]->glyph->format != FT_GLYPH_FORMAT_OUTLINE) { 310 | printf("glyph->format = %4s\n", (char *)&ft_face[i]->glyph->format); 311 | } else { 312 | int gx = sizer_x + (glyph_pos[j].x_offset/64); 313 | int gy = sizer_y + (glyph_pos[j].y_offset/64); // note how the sign differs from the rendering pass 314 | 315 | stuffbaton.min_span_x = INT_MAX; 316 | stuffbaton.max_span_x = INT_MIN; 317 | stuffbaton.min_y = INT_MAX; 318 | stuffbaton.max_y = INT_MIN; 319 | 320 | if ((fterr = FT_Outline_Render(ft_library, &ft_face[i]->glyph->outline, &ftr_params))) 321 | printf("FT_Outline_Render() failed err=%d\n", fterr); 322 | 323 | if (stuffbaton.min_span_x != INT_MAX) { 324 | /* Update values if the spanner was actually called. */ 325 | if (min_x > stuffbaton.min_span_x + gx) 326 | min_x = stuffbaton.min_span_x + gx; 327 | 328 | if (max_x < stuffbaton.max_span_x + gx) 329 | max_x = stuffbaton.max_span_x + gx; 330 | 331 | if (min_y > stuffbaton.min_y + gy) 332 | min_y = stuffbaton.min_y + gy; 333 | 334 | if (max_y < stuffbaton.max_y + gy) 335 | max_y = stuffbaton.max_y + gy; 336 | } else { 337 | /* The spanner wasn't called at all - an empty glyph, like space. */ 338 | if (min_x > gx) min_x = gx; 339 | if (max_x < gx) max_x = gx; 340 | if (min_y > gy) min_y = gy; 341 | if (max_y < gy) max_y = gy; 342 | } 343 | } 344 | } 345 | 346 | sizer_x += glyph_pos[j].x_advance/64; 347 | sizer_y += glyph_pos[j].y_advance/64; // note how the sign differs from the rendering pass 348 | } 349 | /* Still have to take into account last glyph's advance. Or not? */ 350 | if (min_x > sizer_x) min_x = sizer_x; 351 | if (max_x < sizer_x) max_x = sizer_x; 352 | if (min_y > sizer_y) min_y = sizer_y; 353 | if (max_y < sizer_y) max_y = sizer_y; 354 | 355 | /* The bounding box */ 356 | int bbox_w = max_x - min_x; 357 | int bbox_h = max_y - min_y; 358 | 359 | /* Two offsets below position the bounding box with respect to the 'origin', 360 | which is sort of origin of string's first glyph. 361 | 362 | baseline_offset - offset perpendecular to the baseline to the topmost (horizontal), 363 | or leftmost (vertical) pixel drawn. 364 | 365 | baseline_shift - offset along the baseline, from the first drawn glyph's origin 366 | to the leftmost (horizontal), or topmost (vertical) pixel drawn. 367 | 368 | Thus those offsets allow positioning the bounding box to fit the rendered string, 369 | as they are in fact offsets from the point given to the renderer, to the top left 370 | corner of the bounding box. 371 | 372 | NB: baseline is defined as y==0 for horizontal and x==0 for vertical scripts. 373 | (0,0) here is where the first glyph's origin ended up after shaping, not taking 374 | into account glyph_pos[0].xy_offset (yeah, my head hurts too). 375 | */ 376 | 377 | int baseline_offset; 378 | int baseline_shift; 379 | 380 | if (HB_DIRECTION_IS_HORIZONTAL(hb_buffer_get_direction(buf))) { 381 | baseline_offset = max_y; 382 | baseline_shift = min_x; 383 | } 384 | if (HB_DIRECTION_IS_VERTICAL(hb_buffer_get_direction(buf))) { 385 | baseline_offset = min_x; 386 | baseline_shift = max_y; 387 | } 388 | 389 | if (resized) 390 | printf("ex %d string min_x=%d max_x=%d min_y=%d max_y=%d bbox %dx%d boffs %d,%d\n", 391 | i, min_x, max_x, min_y, max_y, bbox_w, bbox_h, baseline_offset, baseline_shift); 392 | 393 | /* The pen/baseline start coordinates in window coordinate system 394 | - with those text placement in the window is controlled. 395 | - note that for RTL scripts pen still goes LTR */ 396 | int x = 0, y = 50 + i * 75; 397 | if (i == ENGLISH) { x = 20; } /* left justify */ 398 | if (i == ARABIC) { x = width - bbox_w - 20; } /* right justify */ 399 | if (i == CHINESE) { x = width/2 - bbox_w/2; } /* center, and for TTB script h_advance is half-width. */ 400 | 401 | /* Draw baseline and the bounding box */ 402 | /* The below is complicated since we simultaneously 403 | convert to the window coordinate system. */ 404 | int left, right, top, bottom; 405 | 406 | if (HB_DIRECTION_IS_HORIZONTAL(hb_buffer_get_direction(buf))) { 407 | /* bounding box in window coordinates without offsets */ 408 | left = x; 409 | right = x + bbox_w; 410 | top = y - bbox_h; 411 | bottom = y; 412 | 413 | /* apply offsets */ 414 | left += baseline_shift; 415 | right += baseline_shift; 416 | top -= baseline_offset - bbox_h; 417 | bottom -= baseline_offset - bbox_h; 418 | 419 | /* draw the baseline */ 420 | hline(sdl_surface, x, x + bbox_w, y, 0x0000ff00); 421 | } 422 | 423 | if (HB_DIRECTION_IS_VERTICAL(hb_buffer_get_direction(buf))) { 424 | left = x; 425 | right = x + bbox_w; 426 | top = y; 427 | bottom = y + bbox_h; 428 | 429 | left += baseline_offset; 430 | right += baseline_offset; 431 | top -= baseline_shift; 432 | bottom -= baseline_shift; 433 | 434 | vline(sdl_surface, y, y + bbox_h, x, 0x0000ff00); 435 | } 436 | if (resized) 437 | printf("ex %d origin %d,%d bbox l=%d r=%d t=%d b=%d\n", 438 | i, x, y, left, right, top, bottom); 439 | 440 | /* +1/-1 are for the bbox borders be the next pixel outside the bbox itself */ 441 | hline(sdl_surface, left - 1, right + 1, top - 1, 0x00ff0000); 442 | hline(sdl_surface, left - 1, right + 1, bottom + 1, 0x00ff0000); 443 | vline(sdl_surface, top - 1, bottom + 1, left - 1, 0x00ff0000); 444 | vline(sdl_surface, top - 1, bottom + 1, right + 1, 0x00ff0000); 445 | 446 | /* set rendering spanner */ 447 | ftr_params.gray_spans = spanner; 448 | 449 | /* initialize rendering part of the baton */ 450 | stuffbaton.pixels = NULL; 451 | stuffbaton.first_pixel = sdl_surface->pixels; 452 | stuffbaton.last_pixel = (uint32_t *) (((uint8_t *) sdl_surface->pixels) + sdl_surface->pitch*sdl_surface->h); 453 | stuffbaton.pitch = sdl_surface->pitch; 454 | stuffbaton.rshift = sdl_surface->format->Rshift; 455 | stuffbaton.gshift = sdl_surface->format->Gshift; 456 | stuffbaton.bshift = sdl_surface->format->Bshift; 457 | 458 | /* render */ 459 | for (unsigned j=0; j < glyph_count; ++j) { 460 | if ((fterr = FT_Load_Glyph(ft_face[i], glyph_info[j].codepoint, 0))) { 461 | printf("load %08x failed fterr=%d.\n", glyph_info[j].codepoint, fterr); 462 | } else { 463 | if (ft_face[i]->glyph->format != FT_GLYPH_FORMAT_OUTLINE) { 464 | printf("glyph->format = %4s\n", (char *)&ft_face[i]->glyph->format); 465 | } else { 466 | int gx = x + (glyph_pos[j].x_offset/64); 467 | int gy = y - (glyph_pos[j].y_offset/64); 468 | 469 | stuffbaton.pixels = (uint32_t *)(((uint8_t *) sdl_surface->pixels) + gy * sdl_surface->pitch) + gx; 470 | 471 | if ((fterr = FT_Outline_Render(ft_library, &ft_face[i]->glyph->outline, &ftr_params))) 472 | printf("FT_Outline_Render() failed err=%d\n", fterr); 473 | } 474 | } 475 | 476 | x += glyph_pos[j].x_advance/64; 477 | y -= glyph_pos[j].y_advance/64; 478 | } 479 | 480 | /* clean up the buffer, but don't kill it just yet */ 481 | hb_buffer_clear_contents(buf); 482 | 483 | } 484 | 485 | SDL_UnlockSurface(sdl_surface); 486 | 487 | /* Blit our new image to our visible screen */ 488 | 489 | SDL_BlitSurface(sdl_surface, NULL, screen, NULL); 490 | SDL_Flip(screen); 491 | 492 | /* Handle SDL events */ 493 | SDL_Event event; 494 | resized = resized ? !resized : resized; 495 | while(SDL_PollEvent(&event)) { 496 | switch (event.type) { 497 | case SDL_KEYDOWN: 498 | if (event.key.keysym.sym == SDLK_ESCAPE) { 499 | done = 1; 500 | } 501 | break; 502 | case SDL_QUIT: 503 | done = 1; 504 | break; 505 | case SDL_VIDEORESIZE: 506 | resized = 1; 507 | width = event.resize.w; 508 | height = event.resize.h; 509 | screen = SDL_SetVideoMode(event.resize.w, event.resize.h, bpp, videoFlags); 510 | if (!screen) { 511 | fprintf(stderr, "Could not get a surface after resize: %s\n", SDL_GetError( )); 512 | exit(-1); 513 | } 514 | /* Recreate an SDL image surface we can draw to. */ 515 | SDL_FreeSurface(sdl_surface); 516 | sdl_surface = SDL_CreateRGBSurface(0, width, height, 32, 0, 0 ,0, 0); 517 | break; 518 | } 519 | } 520 | 521 | SDL_Delay(150); 522 | } 523 | 524 | /* Cleanup */ 525 | hb_buffer_destroy(buf); 526 | for (int i=0; i < NUM_EXAMPLES; ++i) 527 | hb_font_destroy(hb_ft_font[i]); 528 | 529 | FT_Done_FreeType(ft_library); 530 | 531 | SDL_FreeSurface(sdl_surface); 532 | SDL_Quit(); 533 | 534 | return 0; 535 | } 536 | -------------------------------------------------------------------------------- /fonts/DejaVuSerif.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxnt/ex-sdl-freetype-harfbuzz/cdd103518c31e910bb9a08ebc0cf0b26b1ada9f5/fonts/DejaVuSerif.ttf -------------------------------------------------------------------------------- /fonts/README.txt: -------------------------------------------------------------------------------- 1 | The fonts in this directory come from various places. For font licensing information 2 | please check with the specific font vendors (they are all rather open and amiable, but 3 | please review any licenses before you rip the font files from here and embed them in 4 | your application). 5 | 6 | DejaVuSerif.ttf: http://dejavu-fonts.org/ 7 | lateef.ttf : http://scripts.sil.org/cms/scripts/page.php?item_id=ArabicFonts_Download#ofl 8 | fireflysung.ttf: fonts/fireflysung-1.3.0/COPYRIGHT 9 | -------------------------------------------------------------------------------- /fonts/amiri-0.104/OFL.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010-2012, Khaled Hosny (), 2 | with Reserved Font Name Amiri. 3 | 4 | This Font Software is licensed under the SIL Open Font License, Version 1.1. 5 | This license is copied below, and is also available with a FAQ at: 6 | http://scripts.sil.org/OFL 7 | 8 | --------------------------------------------------------------------------- 9 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 10 | --------------------------------------------------------------------------- 11 | 12 | PREAMBLE 13 | 14 | The goals of the Open Font License (OFL) are to stimulate worldwide development 15 | of collaborative font projects, to support the font creation efforts of academic 16 | and linguistic communities, and to provide a free and open framework in which 17 | fonts may be shared and improved in partnership with others. 18 | 19 | The OFL allows the licensed fonts to be used, studied, modified and redistributed 20 | freely as long as they are not sold by themselves. The fonts, including any 21 | derivative works, can be bundled, embedded, redistributed and/or sold with any 22 | software provided that any reserved names are not used by derivative works. The 23 | fonts and derivatives, however, cannot be released under any other type of license. 24 | The requirement for fonts to remain under this license does not apply to any 25 | document created using the fonts or their derivatives. 26 | 27 | DEFINITIONS 28 | 29 | "Font Software" refers to the set of files released by the Copyright Holder(s) under 30 | this license and clearly marked as such. This may include source files, build 31 | scripts and documentation. 32 | 33 | "Reserved Font Name" refers to any names specified as such after the copyright 34 | statement(s). 35 | 36 | "Original Version" refers to the collection of Font Software components as 37 | distributed by the Copyright Holder(s). 38 | 39 | "Modified Version" refers to any derivative made by adding to, deleting, or 40 | substituting -- in part or in whole -- any of the components of the Original Version, 41 | by changing formats or by porting the Font Software to a new environment. 42 | 43 | "Author" refers to any designer, engineer, programmer, technical writer or other 44 | person who contributed to the Font Software. 45 | 46 | PERMISSION & CONDITIONS 47 | 48 | Permission is hereby granted, free of charge, to any person obtaining a copy of the 49 | Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell 50 | modified and unmodified copies of the Font Software, subject to the following 51 | conditions: 52 | 53 | 1) Neither the Font Software nor any of its individual components, in Original or 54 | Modified Versions, may be sold by itself. 55 | 56 | 2) Original or Modified Versions of the Font Software may be bundled, redistributed 57 | and/or sold with any software, provided that each copy contains the above copyright 58 | notice and this license. These can be included either as stand-alone text files, 59 | human-readable headers or in the appropriate machine-readable metadata fields within 60 | text or binary files as long as those fields can be easily viewed by the user. 61 | 62 | 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless 63 | explicit written permission is granted by the corresponding Copyright Holder. This 64 | restriction only applies to the primary font name as presented to the users. 65 | 66 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall 67 | not be used to promote, endorse or advertise any Modified Version, except to 68 | acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with 69 | their explicit written permission. 70 | 71 | 5) The Font Software, modified or unmodified, in part or in whole, must be distributed 72 | entirely under this license, and must not be distributed under any other license. The 73 | requirement for fonts to remain under this license does not apply to any document 74 | created using the Font Software. 75 | 76 | TERMINATION 77 | 78 | This license becomes null and void if any of the above conditions are not met. 79 | 80 | DISCLAIMER 81 | 82 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 83 | INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 84 | PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER 85 | RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 86 | LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, 87 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR 88 | INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. 89 | -------------------------------------------------------------------------------- /fonts/amiri-0.104/README.txt: -------------------------------------------------------------------------------- 1 | designer: Khaled Hosny 2 | url: http://amirifont.org 3 | license: OFL 4 | description: Amiri is a classical Arabic typeface in Naskh style for 5 | typesetting books and other running text. Its design is a revival of the 6 | beautiful typeface pioneered in early 20th century by Bulaq Press in Cairo, 7 | also known as Amiria Press, after which the font is named. 8 | 9 | -------------------------------------------------------------------------------- /fonts/amiri-0.104/amiri-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxnt/ex-sdl-freetype-harfbuzz/cdd103518c31e910bb9a08ebc0cf0b26b1ada9f5/fonts/amiri-0.104/amiri-regular.ttf -------------------------------------------------------------------------------- /fonts/fireflysung-1.3.0/AUTHORS: -------------------------------------------------------------------------------- 1 | AR PL New Sung 2 | ============================================= 3 | 4 | Current Maintainer(s): 5 | ------------------ 6 | FireFly (firefly@firefly.idv.tw) - Design of the embedded bitmap fonts. 7 | 8 | Original Author/Designer: 9 | ------------------- 10 | ARPHIC TECHNOLOGY CO., LTD - Develop of the original truetype font 11 | TEL: 886-2-23512577 12 | FAX: 886-2-23511730 13 | ADDRESS: 13Fl.-1301, No. 88, Sec. 2, Jungshiau E. Rd., Taipei, 100 Taiwan 14 | 15 | -------------------------------------------------------------------------------- /fonts/fireflysung-1.3.0/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright (C) 1994-1999, Arphic Technology Co., Ltd. 2 | Copyright (C) 1999-2004, Firefly and Arphic Technology Co., Ltd. 3 | 4 | Author/Designer: 5 | Original author: 6 | Arphic Technology Co., Ltd. 7 | http://www.arphic.com.tw/ 8 | 9 | Modified by: 10 | Firefly 11 | http://firefly.idv.tw 12 | 13 | NOTICE: This Truetype font contains embedded bitmap fonts made 14 | by firefly and is released as a whole 15 | under the ARPHIC PUBLIC LICENSE. 16 | There are also seperate bitmap fonts made by Firefly and 17 | released under the GENERAL PUBLIC LICENSE (GPL): 18 | http://www.study-area.org/apt/firefly-font/bitmaps/ 19 | 20 | Copyright: 21 | (Copied from 'license/english/ARPHICPL.TXT'. 22 | See 'license/big5/ARPHICPL.TXT' or 'license/gb/ARPHICPL.TXT' 23 | for the Chinese version.) 24 | 25 | ========================================================================== 26 | 27 | ARPHIC PUBLIC LICENSE 28 | 29 | Copyright (C) 1999 Arphic Technology Co., Ltd. 30 | 11Fl. No.168, Yung Chi Rd., Taipei, 110 Taiwan 31 | All rights reserved except as specified below. 32 | 33 | Everyone is permitted to copy and distribute verbatim copies of this 34 | license document, but changing it is forbidden. 35 | 36 | Preamble 37 | 38 | The licenses for most software are designed to take away your freedom 39 | to share and change it. By contrast, the ARPHIC PUBLIC LICENSE 40 | specifically permits and encourages you to use this software, provided 41 | that you give the recipients all the rights that we gave you and make 42 | sure they can get the modifications of this software. 43 | 44 | Legal Terms 45 | 46 | 0. Definitions: 47 | Throughout this License, "Font" means the TrueType fonts "AR PL 48 | Mingti2L Big5", "AR PL KaitiM Big5" (BIG-5 character set) and "AR PL 49 | SungtiL GB", "AR PL KaitiM GB" (GB character set) which are originally 50 | distributed by Arphic, and the derivatives of those fonts created 51 | through any modification including modifying glyph, reordering glyph, 52 | converting format, changing font name, or adding/deleting some 53 | characters in/from glyph table. 54 | 55 | "PL" means "Public License". 56 | 57 | "Copyright Holder" means whoever is named in the copyright or 58 | copyrights for the Font. 59 | 60 | "You" means the licensee, or person copying, redistributing or 61 | modifying the Font. 62 | 63 | "Freely Available" means that you have the freedom to copy or modify 64 | the Font as well as redistribute copies of the Font under the same 65 | conditions you received, not price. If you wish, you can charge for this 66 | service. 67 | 68 | 1. Copying & Distribution 69 | You may copy and distribute verbatim copies of this Font in any 70 | medium, without restriction, provided that you retain this license file 71 | (ARPHICPL.TXT) unaltered in all copies. 72 | 73 | 2. Modification 74 | You may otherwise modify your copy of this Font in any way, including 75 | modifying glyph, reordering glyph, converting format, changing font 76 | name, or adding/deleting some characters in/from glyph table, and copy 77 | and distribute such modifications under the terms of Section 1 above, 78 | provided that the following conditions are met: 79 | 80 | a) You must insert a prominent notice in each modified file stating 81 | how and when you changed that file. 82 | 83 | b) You must make such modifications Freely Available as a whole to 84 | all third parties under the terms of this License, such as by offering 85 | access to copy the modifications from a designated place, or 86 | distributing the modifications on a medium customarily used for software 87 | interchange. 88 | 89 | c) If the modified fonts normally reads commands interactively when 90 | run, you must cause it, when started running for such interactive use in 91 | the most ordinary way, to print or display an announcement including an 92 | appropriate copyright notice and a notice that there is no warranty (or 93 | else, saying that you provide a warranty) and that users may 94 | redistribute the Font under these conditions, and telling the user how 95 | to view a copy of this License. 96 | 97 | These requirements apply to the modified work as a whole. If 98 | identifiable sections of that work are not derived from the Font, and 99 | can be reasonably considered independent and separate works in 100 | themselves, then this License and its terms, do not apply to those 101 | sections when you distribute them as separate works. Therefore, mere 102 | aggregation of another work not based on the Font with the Font on a 103 | volume of a storage or distribution medium does not bring the other work 104 | under the scope of this License. 105 | 106 | 3. Condition Subsequent 107 | You may not copy, modify, sublicense, or distribute the Font except 108 | as expressly provided under this License. Any attempt otherwise to copy, 109 | modify, sublicense or distribute the Font will automatically 110 | retroactively void your rights under this License. However, parties who 111 | have received copies or rights from you under this License will keep 112 | their licenses valid so long as such parties remain in full compliance. 113 | 114 | 4. Acceptance 115 | You are not required to accept this License, since you have not 116 | signed it. However, nothing else grants you permission to copy, modify, 117 | sublicense or distribute the Font. These actions are prohibited by law 118 | if you do not accept this License. Therefore, by copying, modifying, 119 | sublicensing or distributing the Font, you indicate your acceptance of 120 | this License and all its terms and conditions. 121 | 122 | 5. Automatic Receipt 123 | Each time you redistribute the Font, the recipient automatically 124 | receives a license from the original licensor to copy, distribute or 125 | modify the Font subject to these terms and conditions. You may not 126 | impose any further restrictions on the recipients' exercise of the 127 | rights granted herein. You are not responsible for enforcing compliance 128 | by third parties to this License. 129 | 130 | 6. Contradiction 131 | If, as a consequence of a court judgment or allegation of patent 132 | infringement or for any other reason (not limited to patent issues), 133 | conditions are imposed on you (whether by court order, agreement or 134 | otherwise) that contradict the conditions of this License, they do not 135 | excuse you from the conditions of this License. If you cannot distribute 136 | so as to satisfy simultaneously your obligations under this License and 137 | any other pertinent obligations, then as a consequence you may not 138 | distribute the Font at all. For example, if a patent license would not 139 | permit royalty-free redistribution of the Font by all those who receive 140 | copies directly or indirectly through you, then the only way you could 141 | satisfy both it and this License would be to refrain entirely from 142 | distribution of the Font. 143 | 144 | If any portion of this section is held invalid or unenforceable under 145 | any particular circumstance, the balance of the section is intended to 146 | apply and the section as a whole is intended to apply in other 147 | circumstances. 148 | 149 | 7. NO WARRANTY 150 | BECAUSE THE FONT IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR 151 | THE FONT, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 152 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS OR OTHER PARTIES 153 | PROVIDE THE FONT "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 154 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF 155 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 156 | TO THE QUALITY AND PERFORMANCE OF THE FONT IS WITH YOU. SHOULD THE FONT 157 | PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR 158 | OR CORRECTION. 159 | 160 | 8. DAMAGES WAIVER 161 | UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, IN NO 162 | EVENT WILL ANY COPYRIGHTT HOLDERS, OR OTHER PARTIES WHO MAY COPY, MODIFY 163 | OR REDISTRIBUTE THE FONT AS PERMITTED ABOVE, BE LIABLE TO YOU FOR ANY 164 | DIRECT, INDIRECT, CONSEQUENTIAL, INCIDENTAL, SPECIAL OR EXEMPLARY 165 | DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE FONT (INCLUDING 166 | BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 167 | USE, DATA OR PROFITS; OR BUSINESS INTERRUPTION), EVEN IF SUCH HOLDERS OR 168 | OTHER PARTIES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 169 | 170 | ====================================================================== 171 | 172 | 173 | -------------------------------------------------------------------------------- /fonts/fireflysung-1.3.0/Changelog: -------------------------------------------------------------------------------- 1 | Filefly embedded bitmap font -- Public GPL version 2 | Version 1.3.0: 3 | -------------- 4 | March 27, 2005 5 | * Finished 14-pixel(10.5 point) embedded bitmap font 6 | 7 | March 2, 2005 8 | *Added an outline glyph U+79CA and its corresponding bitmap word 9 | *Corrected U+79BF(禿) error of ARPHIC. Proper is (上(禾) + 下(ㄦ)),original was (上(禾) + 下(几)) 10 | *Corrected U+7B3B(笻) error of ARPHIC. Proper is (上(竹) + 左下(工) + 右下(ㄗ)),origianl was (上(竹) + 左下(工) + 右下(邑)) 11 | 12 | March 1, 2005 13 | *Corrected U+7921(礡) error of ARPHIC. Proper is (石 + '薄' take out 水),original was (石 + 薄) 14 | 15 | February 28, 2005 16 | *Added an outline glyph U+74E7 and its corresponding bitmap word 17 | *Added an outline glyph U+751B and its corresponding bitmap word 18 | *Added an outline glyph U+7523 and its corresponding bitmap word 19 | *Added an outline glyph U+77B9 and its corresponding bitmap word 20 | 21 | February 26, 2005 22 | *Added an outline glyph U+7232 and its corresponding bitmap word 23 | 24 | February 24, 2005 25 | *Added an outline glyph U+5586 and its corresponding bitmap word 26 | 27 | February 23, 2005 28 | *Corrected U+4E1F(丟). The top is horizontal,not apostrophe character 29 | *Added an outline glyph U+5803 and its corresponding bitmap word 30 | * Merge COPYING and COPYRIGHT, and made the licese statement 31 | clearly. 32 | * Provide the url for GPLed version of firefly's bitmap fonts 33 | in COPYRIGHT file. 34 | * Added English and Chinese version APL files in license/ 35 | 36 | February 21, 2005 37 | *Added words U+FFE0、U+FFE1、U+FFE3、U+FFE4 38 | 39 | February 20, 2005 40 | *Corrected U+6541(敁) error of ARPHIC.Proper is (占 + 攴),original was (占 + 支) 41 | 42 | February 15, 2005 43 | *Added words from U+F900 to U+FA6A. The total is 363 word (include TrueType and Bitmap ) 44 | 45 | February 14, 2005 46 | *Added words from U+2F00 to U+2FD5. The total is 214 word (include TrueType and Bitmap )。 47 | 48 | Version 1.2.6: 49 | -------------- 50 | February 10, 2005 51 | * Addition U+02c9 TrueType glyph,GB2312 characters ,avoiding Fontconfig missing zh-cn Language tag. 52 | * Add AUTHORS, COPYING, COPYRIGHT, Changelog, Changelog.big5 and fireflysung.ttf to a tarball file. 53 | 54 | Version 1.2.5: 55 | -------------- 56 | February 4, 2005 57 | * Perfect 12, 13, 14, 15, 16 pixel range from U+20 ~ U+7e to match the shape and width of TrueType 58 | * Readjust 12-pixel(9-point) embedded bitmap font ( befort version 1.2.0 , the height of the font beyond one line) 59 | * Corrected U+9462(鑢) error of ARPHIC, revised is (金 + 慮), original was (金 + 盧) 60 | * Perfect other embedded bitmap font in detail 61 | * Removed Vertical Metrics attribute to reduce the file to 16 Mbytes. Installer can easy to assemble 62 | 63 | Version 1.2.0: 64 | -------------- 65 | October 26, 2004 66 | * Finished 16-pixel(12-point) embedded bitmap font 67 | * Use 13-pixel(10-point) embedded bitmap font to show 14-pixel(10.5-point) embedded bitmap font 68 | * Fix the bug of the 20th bit of OS/2 table CodePageRange1 69 | 70 | Version 1.1.0: 71 | -------------- 72 | September 1, 2004 73 | * Finished 15-pixel(11-point) embedded bitmap font 74 | 75 | Version 1.0.0: 76 | -------------- 77 | August 5, 2004 78 | * Finished 12-pixel(9-point) and 13-pixel(10-point) embedded bitmap fonts 79 | 80 | Firefly (firefly@firefly.idv.tw) 81 | -------------------------------------------------------------------------------- /fonts/fireflysung-1.3.0/Changelog.big5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxnt/ex-sdl-freetype-harfbuzz/cdd103518c31e910bb9a08ebc0cf0b26b1ada9f5/fonts/fireflysung-1.3.0/Changelog.big5 -------------------------------------------------------------------------------- /fonts/fireflysung-1.3.0/fireflysung.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxnt/ex-sdl-freetype-harfbuzz/cdd103518c31e910bb9a08ebc0cf0b26b1ada9f5/fonts/fireflysung-1.3.0/fireflysung.ttf -------------------------------------------------------------------------------- /fonts/fireflysung-1.3.0/license/big5/ARPHICPL.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxnt/ex-sdl-freetype-harfbuzz/cdd103518c31e910bb9a08ebc0cf0b26b1ada9f5/fonts/fireflysung-1.3.0/license/big5/ARPHICPL.TXT -------------------------------------------------------------------------------- /fonts/fireflysung-1.3.0/license/english/ARPHICPL.TXT: -------------------------------------------------------------------------------- 1 | ARPHIC PUBLIC LICENSE 2 | 3 | Copyright (C) 1999 Arphic Technology Co., Ltd. 4 | 11Fl. No.168, Yung Chi Rd., Taipei, 110 Taiwan 5 | All rights reserved except as specified below. 6 | 7 | Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is forbidden. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your freedom to share and change it. By contrast, the ARPHIC PUBLIC LICENSE specifically permits and encourages you to use this software, provided that you give the recipients all the rights that we gave you and make sure they can get the modifications of this software. 12 | 13 | Legal Terms 14 | 15 | 0. Definitions: 16 | Throughout this License, "Font" means the TrueType fonts "AR PL Mingti2L Big5", "AR PL KaitiM Big5" (BIG-5 character set) and "AR PL SungtiL GB", "AR PL KaitiM GB" (GB character set) which are originally distributed by Arphic, and the derivatives of those fonts created through any modification including modifying glyph, reordering glyph, converting format, changing font name, or adding/deleting some characters in/from glyph table. 17 | 18 | "PL" means "Public License". 19 | 20 | "Copyright Holder" means whoever is named in the copyright or copyrights for the Font. 21 | 22 | "You" means the licensee, or person copying, redistributing or modifying the Font. 23 | 24 | "Freely Available" means that you have the freedom to copy or modify the Font as well as redistribute copies of the Font under the same conditions you received, not price. If you wish, you can charge for this service. 25 | 26 | 1. Copying & Distribution 27 | You may copy and distribute verbatim copies of this Font in any medium, without restriction, provided that you retain this license file (ARPHICPL.TXT) unaltered in all copies. 28 | 29 | 2. Modification 30 | You may otherwise modify your copy of this Font in any way, including modifying glyph, reordering glyph, converting format, changing font name, or adding/deleting some characters in/from glyph table, and copy and distribute such modifications under the terms of Section 1 above, provided that the following conditions are met: 31 | 32 | a) You must insert a prominent notice in each modified file stating how and when you changed that file. 33 | 34 | b) You must make such modifications Freely Available as a whole to all third parties under the terms of this License, such as by offering access to copy the modifications from a designated place, or distributing the modifications on a medium customarily used for software interchange. 35 | 36 | c) If the modified fonts normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the Font under these conditions, and telling the user how to view a copy of this License. 37 | 38 | These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Font, and can be reasonably considered independent and separate works in themselves, then this License and its terms, do not apply to those sections when you distribute them as separate works. Therefore, mere aggregation of another work not based on the Font with the Font on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 39 | 40 | 3. Condition Subsequent 41 | You may not copy, modify, sublicense, or distribute the Font except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Font will automatically retroactively void your rights under this License. However, parties who have received copies or rights from you under this License will keep their licenses valid so long as such parties remain in full compliance. 42 | 43 | 4. Acceptance 44 | You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to copy, modify, sublicense or distribute the Font. These actions are prohibited by law if you do not accept this License. Therefore, by copying, modifying, sublicensing or distributing the Font, you indicate your acceptance of this License and all its terms and conditions. 45 | 46 | 5. Automatic Receipt 47 | Each time you redistribute the Font, the recipient automatically receives a license from the original licensor to copy, distribute or modify the Font subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 48 | 49 | 6. Contradiction 50 | If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Font at all. For example, if a patent license would not permit royalty-free redistribution of the Font by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Font. 51 | 52 | If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. 53 | 54 | 7. NO WARRANTY 55 | BECAUSE THE FONT IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE FONT, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS OR OTHER PARTIES PROVIDE THE FONT "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE FONT IS WITH YOU. SHOULD THE FONT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 56 | 57 | 8. DAMAGES WAIVER 58 | UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, IN NO EVENT WILL ANY COPYRIGHTT HOLDERS, OR OTHER PARTIES WHO MAY COPY, MODIFY OR REDISTRIBUTE THE FONT AS PERMITTED ABOVE, BE LIABLE TO YOU FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, INCIDENTAL, SPECIAL OR EXEMPLARY DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE FONT (INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA OR PROFITS; OR BUSINESS INTERRUPTION), EVEN IF SUCH HOLDERS OR OTHER PARTIES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 59 | -------------------------------------------------------------------------------- /fonts/fireflysung-1.3.0/license/gb/ARPHICPL.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxnt/ex-sdl-freetype-harfbuzz/cdd103518c31e910bb9a08ebc0cf0b26b1ada9f5/fonts/fireflysung-1.3.0/license/gb/ARPHICPL.TXT -------------------------------------------------------------------------------- /fonts/lateef.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxnt/ex-sdl-freetype-harfbuzz/cdd103518c31e910bb9a08ebc0cf0b26b1ada9f5/fonts/lateef.ttf -------------------------------------------------------------------------------- /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lxnt/ex-sdl-freetype-harfbuzz/cdd103518c31e910bb9a08ebc0cf0b26b1ada9f5/screenshot.png --------------------------------------------------------------------------------