summaryrefslogtreecommitdiff
path: root/legacy/evas/src/lib/engines/common/evas_font_main.c
diff options
context:
space:
mode:
authorRafael Antognolli <antognolli@gmail.com>2012-06-22 20:31:31 +0000
committerRafael Antognolli <antognolli@gmail.com>2012-06-22 20:31:31 +0000
commit2f3426b67c0d04e18669e182c6835b6844739609 (patch)
tree288c00d89da02e8b34840a8cf793ab8dc4cf692e /legacy/evas/src/lib/engines/common/evas_font_main.c
parent64fecc2faba783ef63a719cbf2868458401cb61a (diff)
evas/cserve2: CServe2 client side lib modifications.
Add the calls to request font loading and glyphs on the client lib. SVN revision: 72700
Diffstat (limited to '')
-rw-r--r--legacy/evas/src/lib/engines/common/evas_font_main.c46
1 files changed, 44 insertions, 2 deletions
diff --git a/legacy/evas/src/lib/engines/common/evas_font_main.c b/legacy/evas/src/lib/engines/common/evas_font_main.c
index c09c46b83d..2240fdf57c 100644
--- a/legacy/evas/src/lib/engines/common/evas_font_main.c
+++ b/legacy/evas/src/lib/engines/common/evas_font_main.c
@@ -3,6 +3,10 @@
3 3
4#include "evas_font_private.h" 4#include "evas_font_private.h"
5 5
6#ifdef EVAS_CSERVE2
7# include "../../cserve2/evas_cs2_private.h"
8#endif
9
6#include <assert.h> 10#include <assert.h>
7 11
8#include FT_OUTLINE_H 12#include FT_OUTLINE_H
@@ -364,7 +368,15 @@ evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt idx)
364 { 368 {
365 fg = _fash_gl_find(fi->fash, idx); 369 fg = _fash_gl_find(fi->fash, idx);
366 if (fg == (void *)(-1)) return NULL; 370 if (fg == (void *)(-1)) return NULL;
367 else if (fg) return fg; 371 else if (fg)
372 {
373#ifdef EVAS_CSERVE2
374 if (fi->cs2_handler)
375 evas_cserve2_font_glyph_used(fi->cs2_handler, idx,
376 fi->hinting);
377#endif
378 return fg;
379 }
368 } 380 }
369// fg = eina_hash_find(fi->glyphs, &hindex); 381// fg = eina_hash_find(fi->glyphs, &hindex);
370// if (fg) return fg; 382// if (fg) return fg;
@@ -413,6 +425,7 @@ evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt idx)
413 &outbox); 425 &outbox);
414 fg->width = EVAS_FONT_ROUND_26_6_TO_INT(outbox.xMax - outbox.xMin); 426 fg->width = EVAS_FONT_ROUND_26_6_TO_INT(outbox.xMax - outbox.xMin);
415 fg->x_bear = EVAS_FONT_ROUND_26_6_TO_INT(outbox.xMin); 427 fg->x_bear = EVAS_FONT_ROUND_26_6_TO_INT(outbox.xMin);
428 fg->y_bear = EVAS_FONT_ROUND_26_6_TO_INT(outbox.yMax);
416 } 429 }
417 430
418 fg->index = idx; 431 fg->index = idx;
@@ -421,6 +434,11 @@ evas_common_font_int_cache_glyph_get(RGBA_Font_Int *fi, FT_UInt idx)
421 if (!fi->fash) fi->fash = _fash_gl_new(); 434 if (!fi->fash) fi->fash = _fash_gl_new();
422 if (fi->fash) _fash_gl_add(fi->fash, idx, fg); 435 if (fi->fash) _fash_gl_add(fi->fash, idx, fg);
423 436
437#ifdef EVAS_CSERVE2
438 if (fi->cs2_handler)
439 evas_cserve2_font_glyph_request(fi->cs2_handler, idx, fi->hinting);
440#endif
441
424// eina_hash_direct_add(fi->glyphs, &fg->index, fg); 442// eina_hash_direct_add(fi->glyphs, &fg->index, fg);
425 return fg; 443 return fg;
426} 444}
@@ -431,6 +449,20 @@ evas_common_font_int_cache_glyph_render(RGBA_Font_Glyph *fg)
431 int size; 449 int size;
432 FT_Error error; 450 FT_Error error;
433 RGBA_Font_Int *fi = fg->fi; 451 RGBA_Font_Int *fi = fg->fi;
452 FT_BitmapGlyph fbg;
453
454#ifdef EVAS_CSERVE2
455 if (fi->cs2_handler)
456 {
457 fg->glyph_out = evas_cserve2_font_glyph_bitmap_get(fi->cs2_handler,
458 fg->index,
459 fg->fi->hinting);
460 if (fg->glyph_out)
461 return EINA_TRUE;
462 }
463#endif
464
465 /* no cserve2 case */
434 FTLOCK(); 466 FTLOCK();
435 error = FT_Glyph_To_Bitmap(&(fg->glyph), FT_RENDER_MODE_NORMAL, 0, 1); 467 error = FT_Glyph_To_Bitmap(&(fg->glyph), FT_RENDER_MODE_NORMAL, 0, 1);
436 if (error) 468 if (error)
@@ -444,7 +476,17 @@ evas_common_font_int_cache_glyph_render(RGBA_Font_Glyph *fg)
444 } 476 }
445 FTUNLOCK(); 477 FTUNLOCK();
446 478
447 fg->glyph_out = (FT_BitmapGlyph)fg->glyph; 479 fbg = (FT_BitmapGlyph)fg->glyph;
480
481 fg->glyph_out = malloc(sizeof(RGBA_Font_Glyph_Out));
482 fg->glyph_out->bitmap.rows = fbg->bitmap.rows;
483 fg->glyph_out->bitmap.width = fbg->bitmap.width;
484 fg->glyph_out->bitmap.pitch = fbg->bitmap.pitch;
485 fg->glyph_out->bitmap.buffer = fbg->bitmap.buffer;
486 fg->glyph_out->bitmap.num_grays = fbg->bitmap.num_grays;
487 fg->glyph_out->bitmap.pixel_mode = fbg->bitmap.pixel_mode;
488
489 fg->glyph_out_free = free;
448 /* This '+ 200' is just an estimation of how much memory freetype will use 490 /* This '+ 200' is just an estimation of how much memory freetype will use
449 * on it's size. This value is not really used anywhere in code - it's 491 * on it's size. This value is not really used anywhere in code - it's
450 * only for statistics. */ 492 * only for statistics. */