2008-07-19 10:13:42 -07:00
|
|
|
#ifndef _EVAS_FONT_H
|
|
|
|
#define _EVAS_FONT_H
|
2017-11-06 18:22:09 -08:00
|
|
|
|
|
|
|
typedef unsigned char DATA8;
|
|
|
|
typedef unsigned long long DATA64;
|
|
|
|
|
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_FREETYPE_H
|
|
|
|
#include FT_GLYPH_H
|
|
|
|
#include FT_SIZES_H
|
|
|
|
#include FT_MODULE_H
|
|
|
|
|
|
|
|
#ifndef FT_HAS_COLOR
|
|
|
|
# define FT_HAS_COLOR(face) 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef FT_LOAD_COLOR
|
|
|
|
# define FT_LOAD_COLOR FT_LOAD_DEFAULT
|
|
|
|
#endif
|
|
|
|
|
2017-11-07 04:53:45 -08:00
|
|
|
#include <Eina.h>
|
|
|
|
|
2017-12-19 05:11:44 -08:00
|
|
|
#include "evas_text_utils.h"
|
|
|
|
|
2017-11-06 18:22:09 -08:00
|
|
|
#ifdef EAPI
|
|
|
|
# undef EAPI
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
2018-01-18 01:04:03 -08:00
|
|
|
# ifdef EFL_BUILD
|
2017-11-06 18:22:09 -08:00
|
|
|
# ifdef DLL_EXPORT
|
|
|
|
# define EAPI __declspec(dllexport)
|
|
|
|
# else
|
|
|
|
# define EAPI
|
2018-01-18 01:04:03 -08:00
|
|
|
# endif
|
2017-11-06 18:22:09 -08:00
|
|
|
# else
|
|
|
|
# define EAPI __declspec(dllimport)
|
2018-01-18 01:04:03 -08:00
|
|
|
# endif
|
2017-11-06 18:22:09 -08:00
|
|
|
#else
|
|
|
|
# ifdef __GNUC__
|
|
|
|
# if __GNUC__ >= 4
|
|
|
|
# define EAPI __attribute__ ((visibility("default")))
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
2018-01-18 01:04:03 -08:00
|
|
|
#endif
|
2017-11-06 18:22:09 -08:00
|
|
|
|
|
|
|
#define LK(x) Eina_Lock x
|
2017-11-07 03:15:48 -08:00
|
|
|
#define LKI(x) eina_lock_new(&(x))
|
2017-11-06 18:22:09 -08:00
|
|
|
#define LKD(x) eina_lock_free(&(x))
|
2017-11-07 03:15:48 -08:00
|
|
|
#define LKL(x) eina_lock_take(&(x))
|
|
|
|
#define LKT(x) eina_lock_take_try(&(x))
|
|
|
|
#define LKU(x) eina_lock_release(&(x))
|
|
|
|
#define LKDBG(x) eina_lock_debug(&(x))
|
2017-11-06 18:22:09 -08:00
|
|
|
|
evas_object_textblock: add support for variation sequences
Summary: update font processing to handle variation sequences unicodes to select proper glypg in respect to variation seqences
Test Plan:
```
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1
#include <Eina.h>
#include <Efl.h>
#include <Elementary.h>
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *win, *textblock;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_util_standard_add("Main", "");
elm_win_autodel_set(win, EINA_TRUE);
textblock = evas_object_textblock_add(win);
efl_canvas_text_style_set(textblock,NULL,"DEFAULT='font=DejaVuSans font_fallbacks=SamsungColorEmoji color=#000 font_size=20'");
evas_object_textblock_text_markup_set(textblock, "8️⃣☪️AAA☪︎1234567️⃣");
evas_object_size_hint_weight_set(textblock, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(textblock, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(textblock);
evas_object_move(textblock, 0, 0);
evas_object_resize(textblock, 320, 320);
evas_object_resize(win, 320, 320);
evas_object_show(win);
elm_run();
return 0;
}
ELM_MAIN()
```
Reviewers: woohyun, bowonryu, segfaultxavi, cedric, bu5hm4n
Reviewed By: woohyun, cedric
Subscribers: raster, bu5hm4n, subodh6129, herdsman, segfaultxavi, zmike, cedric, #committers, #reviewers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9053
2019-12-11 23:22:12 -08:00
|
|
|
/**
|
|
|
|
* See explanation of variation_sequences at:
|
|
|
|
* https://unicode.org/Public/UCD/latest/ucd/StandardizedVariants.txt
|
|
|
|
* https://unicode.org/reports/tr37/
|
|
|
|
* https://unicode.org/ivd/
|
|
|
|
* https://www.freetype.org/freetype2/docs/reference/ft2-glyph_variants.html
|
|
|
|
*/
|
|
|
|
#define VAR_SEQ(x) GENERIC_VARIATION_SEQUENCES(x) | IDEOGRAPHICS_VARIATION_SEQUENCES(x) | MANGOLIAN_VARIATION_SEQUENCES(x)
|
|
|
|
#define GENERIC_VARIATION_SEQUENCES(x) (x>=0xFE00 && x<=0xFE0F) ? x : 0
|
|
|
|
#define IDEOGRAPHICS_VARIATION_SEQUENCES(x) (x>=0xE0100 && x<=0xE01EF) ? x : 0
|
|
|
|
#define MANGOLIAN_VARIATION_SEQUENCES(x) (x>=0x180B && x<=0x180D) ? x : 0
|
|
|
|
/**
|
|
|
|
* http://unicode.org/emoji/charts/emoji-variants.html
|
|
|
|
*/
|
|
|
|
#define VARIATION_EMOJI_PRESENTATION 0xFE0F
|
|
|
|
#define VARIATION_TEXT_PRESENTATION 0xFE0E
|
|
|
|
|
|
|
|
/**
|
|
|
|
* These Options (Flags) are used with evas_common_font_glyph_search function
|
|
|
|
*/
|
|
|
|
#define EVAS_FONT_SEARCH_OPTION_NONE 0x0000
|
|
|
|
#define EVAS_FONT_SEARCH_OPTION_SKIP_COLOR 0x0001
|
|
|
|
|
2008-07-19 10:13:42 -07:00
|
|
|
|
evas_object_textblock: add support for variation sequences
Summary: update font processing to handle variation sequences unicodes to select proper glypg in respect to variation seqences
Test Plan:
```
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1
#include <Eina.h>
#include <Efl.h>
#include <Elementary.h>
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *win, *textblock;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_util_standard_add("Main", "");
elm_win_autodel_set(win, EINA_TRUE);
textblock = evas_object_textblock_add(win);
efl_canvas_text_style_set(textblock,NULL,"DEFAULT='font=DejaVuSans font_fallbacks=SamsungColorEmoji color=#000 font_size=20'");
evas_object_textblock_text_markup_set(textblock, "8️⃣☪️AAA☪︎1234567️⃣");
evas_object_size_hint_weight_set(textblock, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(textblock, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(textblock);
evas_object_move(textblock, 0, 0);
evas_object_resize(textblock, 320, 320);
evas_object_resize(win, 320, 320);
evas_object_show(win);
elm_run();
return 0;
}
ELM_MAIN()
```
Reviewers: woohyun, bowonryu, segfaultxavi, cedric, bu5hm4n
Reviewed By: woohyun, cedric
Subscribers: raster, bu5hm4n, subodh6129, herdsman, segfaultxavi, zmike, cedric, #committers, #reviewers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9053
2019-12-11 23:22:12 -08:00
|
|
|
#define FASH_INT_MAGIC 0x01012345
|
|
|
|
#define FASH_GLYPH_MAGIC 0x02012345
|
2017-11-06 18:22:09 -08:00
|
|
|
|
|
|
|
enum _Evas_Font_Style
|
|
|
|
{
|
|
|
|
EVAS_FONT_STYLE_SLANT,
|
|
|
|
EVAS_FONT_STYLE_WEIGHT,
|
|
|
|
EVAS_FONT_STYLE_WIDTH
|
|
|
|
};
|
|
|
|
|
|
|
|
enum _Evas_Font_Slant
|
|
|
|
{
|
|
|
|
EVAS_FONT_SLANT_NORMAL,
|
|
|
|
EVAS_FONT_SLANT_OBLIQUE,
|
|
|
|
EVAS_FONT_SLANT_ITALIC
|
|
|
|
};
|
|
|
|
|
|
|
|
enum _Evas_Font_Weight
|
|
|
|
{
|
|
|
|
EVAS_FONT_WEIGHT_NORMAL,
|
|
|
|
EVAS_FONT_WEIGHT_THIN,
|
|
|
|
EVAS_FONT_WEIGHT_ULTRALIGHT,
|
|
|
|
EVAS_FONT_WEIGHT_EXTRALIGHT,
|
|
|
|
EVAS_FONT_WEIGHT_LIGHT,
|
|
|
|
EVAS_FONT_WEIGHT_BOOK,
|
|
|
|
EVAS_FONT_WEIGHT_MEDIUM,
|
|
|
|
EVAS_FONT_WEIGHT_SEMIBOLD,
|
|
|
|
EVAS_FONT_WEIGHT_BOLD,
|
|
|
|
EVAS_FONT_WEIGHT_ULTRABOLD,
|
|
|
|
EVAS_FONT_WEIGHT_EXTRABOLD,
|
|
|
|
EVAS_FONT_WEIGHT_BLACK,
|
|
|
|
EVAS_FONT_WEIGHT_EXTRABLACK
|
|
|
|
};
|
|
|
|
|
|
|
|
enum _Evas_Font_Width
|
|
|
|
{
|
|
|
|
EVAS_FONT_WIDTH_NORMAL,
|
|
|
|
EVAS_FONT_WIDTH_ULTRACONDENSED,
|
|
|
|
EVAS_FONT_WIDTH_EXTRACONDENSED,
|
|
|
|
EVAS_FONT_WIDTH_CONDENSED,
|
|
|
|
EVAS_FONT_WIDTH_SEMICONDENSED,
|
|
|
|
EVAS_FONT_WIDTH_SEMIEXPANDED,
|
|
|
|
EVAS_FONT_WIDTH_EXPANDED,
|
|
|
|
EVAS_FONT_WIDTH_EXTRAEXPANDED,
|
|
|
|
EVAS_FONT_WIDTH_ULTRAEXPANDED
|
|
|
|
};
|
|
|
|
|
|
|
|
enum _Evas_Font_Spacing
|
|
|
|
{
|
|
|
|
EVAS_FONT_SPACING_PROPORTIONAL,
|
|
|
|
EVAS_FONT_SPACING_DUAL,
|
|
|
|
EVAS_FONT_SPACING_MONO,
|
|
|
|
EVAS_FONT_SPACING_CHARCELL
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum _Evas_Font_Style Evas_Font_Style;
|
|
|
|
typedef enum _Evas_Font_Slant Evas_Font_Slant;
|
|
|
|
typedef enum _Evas_Font_Weight Evas_Font_Weight;
|
|
|
|
typedef enum _Evas_Font_Width Evas_Font_Width;
|
|
|
|
typedef enum _Evas_Font_Spacing Evas_Font_Spacing;
|
|
|
|
|
|
|
|
typedef struct _Evas_Font_Dir Evas_Font_Dir;
|
|
|
|
typedef struct _Evas_Font Evas_Font;
|
|
|
|
typedef struct _Evas_Font_Alias Evas_Font_Alias;
|
|
|
|
typedef struct _Evas_Font_Description Evas_Font_Description;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _RGBA_Font RGBA_Font;
|
|
|
|
typedef struct _RGBA_Font_Int RGBA_Font_Int;
|
|
|
|
typedef struct _RGBA_Font_Source RGBA_Font_Source;
|
|
|
|
typedef struct _RGBA_Font_Glyph RGBA_Font_Glyph;
|
|
|
|
typedef struct _RGBA_Font_Glyph_Out RGBA_Font_Glyph_Out;
|
|
|
|
|
evas_object_textblock: add support for variation sequences
Summary: update font processing to handle variation sequences unicodes to select proper glypg in respect to variation seqences
Test Plan:
```
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1
#include <Eina.h>
#include <Efl.h>
#include <Elementary.h>
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *win, *textblock;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_util_standard_add("Main", "");
elm_win_autodel_set(win, EINA_TRUE);
textblock = evas_object_textblock_add(win);
efl_canvas_text_style_set(textblock,NULL,"DEFAULT='font=DejaVuSans font_fallbacks=SamsungColorEmoji color=#000 font_size=20'");
evas_object_textblock_text_markup_set(textblock, "8️⃣☪️AAA☪︎1234567️⃣");
evas_object_size_hint_weight_set(textblock, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(textblock, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(textblock);
evas_object_move(textblock, 0, 0);
evas_object_resize(textblock, 320, 320);
evas_object_resize(win, 320, 320);
evas_object_show(win);
elm_run();
return 0;
}
ELM_MAIN()
```
Reviewers: woohyun, bowonryu, segfaultxavi, cedric, bu5hm4n
Reviewed By: woohyun, cedric
Subscribers: raster, bu5hm4n, subodh6129, herdsman, segfaultxavi, zmike, cedric, #committers, #reviewers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9053
2019-12-11 23:22:12 -08:00
|
|
|
typedef struct _Fash_Item_variation_Index_Item Fash_Item_variation_Index_Item;
|
|
|
|
typedef struct _Fash_Item_variation_List Fash_Item_variation_List;
|
|
|
|
typedef struct _Fash_Item_Index_Map_Variations Fash_Item_Index_Map_Variations;
|
|
|
|
|
2017-11-06 18:22:09 -08:00
|
|
|
typedef struct _Fash_Item_Index_Map Fash_Item_Index_Map;
|
|
|
|
typedef struct _Fash_Int_Map Fash_Int_Map;
|
|
|
|
typedef struct _Fash_Int_Map2 Fash_Int_Map2;
|
|
|
|
typedef struct _Fash_Int Fash_Int;
|
|
|
|
|
|
|
|
|
|
|
|
struct _Fash_Item_Index_Map
|
|
|
|
{
|
|
|
|
RGBA_Font_Int *fint;
|
|
|
|
int index;
|
|
|
|
};
|
evas_object_textblock: add support for variation sequences
Summary: update font processing to handle variation sequences unicodes to select proper glypg in respect to variation seqences
Test Plan:
```
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1
#include <Eina.h>
#include <Efl.h>
#include <Elementary.h>
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *win, *textblock;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_util_standard_add("Main", "");
elm_win_autodel_set(win, EINA_TRUE);
textblock = evas_object_textblock_add(win);
efl_canvas_text_style_set(textblock,NULL,"DEFAULT='font=DejaVuSans font_fallbacks=SamsungColorEmoji color=#000 font_size=20'");
evas_object_textblock_text_markup_set(textblock, "8️⃣☪️AAA☪︎1234567️⃣");
evas_object_size_hint_weight_set(textblock, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(textblock, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(textblock);
evas_object_move(textblock, 0, 0);
evas_object_resize(textblock, 320, 320);
evas_object_resize(win, 320, 320);
evas_object_show(win);
elm_run();
return 0;
}
ELM_MAIN()
```
Reviewers: woohyun, bowonryu, segfaultxavi, cedric, bu5hm4n
Reviewed By: woohyun, cedric
Subscribers: raster, bu5hm4n, subodh6129, herdsman, segfaultxavi, zmike, cedric, #committers, #reviewers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9053
2019-12-11 23:22:12 -08:00
|
|
|
struct _Fash_Item_variation_Index_Item
|
|
|
|
{
|
|
|
|
Fash_Item_Index_Map item;
|
|
|
|
Eina_Unicode variation_sequence;
|
|
|
|
};
|
|
|
|
struct _Fash_Item_variation_List
|
|
|
|
{
|
|
|
|
Fash_Item_variation_Index_Item *list;
|
|
|
|
size_t length;
|
|
|
|
size_t capacity;
|
|
|
|
};
|
|
|
|
struct _Fash_Item_Index_Map_Variations
|
|
|
|
{
|
|
|
|
Fash_Item_Index_Map item;
|
|
|
|
Fash_Item_variation_List *variations;
|
|
|
|
};
|
2017-11-06 18:22:09 -08:00
|
|
|
struct _Fash_Int_Map
|
|
|
|
{
|
evas_object_textblock: add support for variation sequences
Summary: update font processing to handle variation sequences unicodes to select proper glypg in respect to variation seqences
Test Plan:
```
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1
#include <Eina.h>
#include <Efl.h>
#include <Elementary.h>
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *win, *textblock;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_util_standard_add("Main", "");
elm_win_autodel_set(win, EINA_TRUE);
textblock = evas_object_textblock_add(win);
efl_canvas_text_style_set(textblock,NULL,"DEFAULT='font=DejaVuSans font_fallbacks=SamsungColorEmoji color=#000 font_size=20'");
evas_object_textblock_text_markup_set(textblock, "8️⃣☪️AAA☪︎1234567️⃣");
evas_object_size_hint_weight_set(textblock, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(textblock, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(textblock);
evas_object_move(textblock, 0, 0);
evas_object_resize(textblock, 320, 320);
evas_object_resize(win, 320, 320);
evas_object_show(win);
elm_run();
return 0;
}
ELM_MAIN()
```
Reviewers: woohyun, bowonryu, segfaultxavi, cedric, bu5hm4n
Reviewed By: woohyun, cedric
Subscribers: raster, bu5hm4n, subodh6129, herdsman, segfaultxavi, zmike, cedric, #committers, #reviewers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9053
2019-12-11 23:22:12 -08:00
|
|
|
Fash_Item_Index_Map_Variations items[256];
|
2017-11-06 18:22:09 -08:00
|
|
|
};
|
|
|
|
struct _Fash_Int_Map2
|
|
|
|
{
|
|
|
|
Fash_Int_Map *bucket[256];
|
|
|
|
};
|
|
|
|
struct _Fash_Int
|
|
|
|
{
|
evas_object_textblock: add support for variation sequences
Summary: update font processing to handle variation sequences unicodes to select proper glypg in respect to variation seqences
Test Plan:
```
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1
#include <Eina.h>
#include <Efl.h>
#include <Elementary.h>
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *win, *textblock;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_util_standard_add("Main", "");
elm_win_autodel_set(win, EINA_TRUE);
textblock = evas_object_textblock_add(win);
efl_canvas_text_style_set(textblock,NULL,"DEFAULT='font=DejaVuSans font_fallbacks=SamsungColorEmoji color=#000 font_size=20'");
evas_object_textblock_text_markup_set(textblock, "8️⃣☪️AAA☪︎1234567️⃣");
evas_object_size_hint_weight_set(textblock, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(textblock, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(textblock);
evas_object_move(textblock, 0, 0);
evas_object_resize(textblock, 320, 320);
evas_object_resize(win, 320, 320);
evas_object_show(win);
elm_run();
return 0;
}
ELM_MAIN()
```
Reviewers: woohyun, bowonryu, segfaultxavi, cedric, bu5hm4n
Reviewed By: woohyun, cedric
Subscribers: raster, bu5hm4n, subodh6129, herdsman, segfaultxavi, zmike, cedric, #committers, #reviewers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9053
2019-12-11 23:22:12 -08:00
|
|
|
unsigned int MAGIC;
|
2017-11-06 18:22:09 -08:00
|
|
|
Fash_Int_Map2 *bucket[256];
|
|
|
|
void (*freeme) (Fash_Int *fash);
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _Fash_Glyph_Map Fash_Glyph_Map;
|
|
|
|
typedef struct _Fash_Glyph_Map2 Fash_Glyph_Map2;
|
|
|
|
typedef struct _Fash_Glyph Fash_Glyph;
|
|
|
|
struct _Fash_Glyph_Map
|
|
|
|
{
|
|
|
|
RGBA_Font_Glyph *item[256];
|
|
|
|
};
|
|
|
|
struct _Fash_Glyph_Map2
|
|
|
|
{
|
|
|
|
Fash_Glyph_Map *bucket[256];
|
|
|
|
};
|
|
|
|
struct _Fash_Glyph
|
|
|
|
{
|
evas_object_textblock: add support for variation sequences
Summary: update font processing to handle variation sequences unicodes to select proper glypg in respect to variation seqences
Test Plan:
```
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1
#include <Eina.h>
#include <Efl.h>
#include <Elementary.h>
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *win, *textblock;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_util_standard_add("Main", "");
elm_win_autodel_set(win, EINA_TRUE);
textblock = evas_object_textblock_add(win);
efl_canvas_text_style_set(textblock,NULL,"DEFAULT='font=DejaVuSans font_fallbacks=SamsungColorEmoji color=#000 font_size=20'");
evas_object_textblock_text_markup_set(textblock, "8️⃣☪️AAA☪︎1234567️⃣");
evas_object_size_hint_weight_set(textblock, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(textblock, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(textblock);
evas_object_move(textblock, 0, 0);
evas_object_resize(textblock, 320, 320);
evas_object_resize(win, 320, 320);
evas_object_show(win);
elm_run();
return 0;
}
ELM_MAIN()
```
Reviewers: woohyun, bowonryu, segfaultxavi, cedric, bu5hm4n
Reviewed By: woohyun, cedric
Subscribers: raster, bu5hm4n, subodh6129, herdsman, segfaultxavi, zmike, cedric, #committers, #reviewers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9053
2019-12-11 23:22:12 -08:00
|
|
|
unsigned int MAGIC;
|
2017-11-06 18:22:09 -08:00
|
|
|
Fash_Glyph_Map2 *bucket[256];
|
|
|
|
void (*freeme) (Fash_Glyph *fash);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
typedef enum _Font_Hint_Flags
|
|
|
|
{
|
|
|
|
FONT_NO_HINT,
|
|
|
|
FONT_AUTO_HINT,
|
|
|
|
FONT_BYTECODE_HINT
|
|
|
|
} Font_Hint_Flags;
|
|
|
|
|
|
|
|
typedef enum _Font_Rend_Flags
|
|
|
|
{
|
|
|
|
FONT_REND_REGULAR = 0,
|
|
|
|
FONT_REND_SLANT = (1 << 0),
|
|
|
|
FONT_REND_WEIGHT = (1 << 1),
|
|
|
|
} Font_Rend_Flags;
|
|
|
|
|
|
|
|
struct _RGBA_Font
|
|
|
|
{
|
|
|
|
Eina_List *fonts;
|
|
|
|
Fash_Int *fash;
|
|
|
|
Font_Hint_Flags hinting;
|
|
|
|
int references;
|
|
|
|
LK(lock);
|
|
|
|
unsigned char sizeok : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct _Evas_Font_Dir
|
|
|
|
{
|
|
|
|
Eina_Hash *lookup;
|
|
|
|
Eina_List *fonts;
|
|
|
|
Eina_List *aliases;
|
|
|
|
DATA64 dir_mod_time;
|
|
|
|
DATA64 fonts_dir_mod_time;
|
|
|
|
DATA64 fonts_alias_mod_time;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Evas_Font
|
|
|
|
{
|
|
|
|
struct {
|
|
|
|
const char *prop[14];
|
|
|
|
} x;
|
|
|
|
struct {
|
|
|
|
const char *name;
|
|
|
|
} simple;
|
|
|
|
const char *path;
|
|
|
|
char type;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Evas_Font_Alias
|
|
|
|
{
|
|
|
|
const char *alias;
|
|
|
|
Evas_Font *fn;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Evas_Font_Description
|
|
|
|
{
|
|
|
|
int ref;
|
|
|
|
Eina_Stringshare *name;
|
|
|
|
Eina_Stringshare *fallbacks;
|
|
|
|
Eina_Stringshare *lang;
|
|
|
|
Eina_Stringshare *style;
|
|
|
|
|
|
|
|
Evas_Font_Slant slant;
|
|
|
|
Evas_Font_Weight weight;
|
|
|
|
Evas_Font_Width width;
|
|
|
|
Evas_Font_Spacing spacing;
|
|
|
|
|
|
|
|
Eina_Bool is_new : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _RGBA_Font_Int
|
|
|
|
{
|
|
|
|
EINA_INLIST;
|
|
|
|
RGBA_Font_Source *src;
|
|
|
|
Eina_Hash *kerning;
|
|
|
|
Fash_Glyph *fash;
|
|
|
|
unsigned int size;
|
evas_text: reduce Video Memory & RAM needed for text textures (Color Glyphs)
Summary:
Texture created for bitmap font glyph, with a fixed size in the font, this size could be much bigger than the needed size in application.
Then a scale factor is applied to these textures when drawn.
Now, instead, we will create smaller bitmaps and create texture from them with reduced texture size (that is not needed).
** This will affect both Video Memory and Ram needed to store glyphs**
Open this file {F3883874} in terminology before and after applying the patch and notice the difference.
Test Plan:
**Notes**
- You need to scroll down to make all glyphs visible, then notice Video/Ram memory
| | Video | Ram
|----------------------|-------|-----
| Before (Font_size=50) | 360 | 300
| After (Font_size=50) | 40 | 100
| Ration After/before | 11% | 33%
**I notice speed up in text rendering for small font size**
```
#include <Elementary.h>
typedef struct _APP
{
Evas_Object *tb1;
Evas_Object *btnLoad;
} APP;
char *text = "<align=center><color=#4DE0FFFF underline=on underline_color=#4DE0FFFF><a href='tel:1234567890'>1234567890</a></color>😀😁😂🤣😃😄😅😆😉😊😋😎😍😘😗😙😚☺🙂🤗🤔😐😑😶🙄😏😣😥😮🤐😯😪😫😴😌🤓😛😜😝🤤😒😓😔😕🙃🤑😲☹🙁😖😞😟😤😢😭😦😧😨😩😬😰😱😳😵😡😠😇🤠🤡🤥😷🤒🤕🤢🤧☻😈👿👹👺💀☠👻👽👾🤖💩😺😸😹😻😼😽🙀😿😾🙈🙉🙊👦👧👨👩👵👶👼👨⚕️👩⚕️👨🎓👩🎓👨🏫👩🏫👨⚖👩⚖👨🌾👩🌾👨🍳👩🍳👨🔧👩🔧👨🏭👩🏭👨💼👩💼👨🔬👩🔬👨💻👩💻👨🎤👩🎤👨🎨👩🎨👨✈️👩✈️👨🚀👩🚀👨🚒👩🚒👮♂️👮♀️🕵️♂️🕵️♀️💂♂️💂♀️👷♂️👷♀️👳♂️👳♀️👱♂️👱♀️🎅🤶👸🤴👰🤵🤰👲🙍♂️🙍♀️🙎♂️🙎♀️🙅♂️🙅♀️🙆♂️🙆♀️💁♂️💁♀️🙋♂️🙋♀️🙇♂️🙇♀️🤦♂️🤦♀️🤷♂️🤷♀️💆♂️💆♀️💇♂️💇♀️🚶♂️🚶♀️🏃♂️🏃♀️💃🕺👯♂️👯♀️🕴🗣👤👥👫👬👭💏💑👪👨👩👧👨👩👧👦👨👩👦👦👨👩👧👧👨👦👨👦👦👨👧👨👧👦👨👧👧👩👦👩👦👦👩👧👩👧👦👩👧👧💪🤳👈👉☝️👆🖕👇✌🤞🖖🤘👊🖐✋👌👍👎✊👊🤛🤜🤚👋👏✍👐🙌🙏🤝💅👂👃👣👀👁👅👄💋💘❤💓💔💕💖💗💙💚💛💜🖤💝💞💟❣💌💤💢💣💥💦💨💫💬🗨🗯💭🕳👓🕶👔👕👖👗👘👙👚👛👜👝🛍🎒👞👟👠👡👢👑👒🎩🎓⛑📿💄💍💎🐵🐒🦍🐶🐕🐩🐺🦊🐱🐈🦁🐯🐅🐆🐴🐎🦌🦄🐮🐂🐃🐄🐷🐖🐗🐽🐏🐑🐐🐪🐫🐘🦏🐭🐁🐀🐹🐰🐇🐿🦇🐻🐨🐼🐾🦃🐔🐓🐣🐤🐥🐦🐧🕊🦅🦆🦉🐸🐊🐢🦎🐍🐲🐉🐳🐋🐬🐟🐠🐡🦈🐙🐚🦀🦐🦑🦋🐌🐛🐜🐝🐞🕷🕸🦂💐🌸💮🏵🌹🥀🌺🌻🌼🌷⚘🌱🌲🌳🌴🌵🌾🌿☘🍀🍁🍂🍃🍇🍈🍉🍊🍋🍌🍍🍎🍏🍐🍑🍒🍓🍅🥝🥑🍆🥔🥕🌽🌶🥒🍄🥜🌰🍞🥐🥖🥞🧀🍖🍗🥓🍔🍟🍕🌭🌮🌯🥙🥚🍳🥘🍲🥗🍿🍱🍘🍙🍚🍛🍜🍝🍠🍢🍣🍤🍥🍡🍦🍧🍨🍩🍪🎂🍰🍫🍬🍭🍮🍯🍼🥛☕🍵🍶🍾🍷🍸🍹🍺🍻🥂🍽🍴🥄🔪🏺🎃🎄🎆🎇✨🎈🎉🎊🎋🎍🎎🎏🎐🎑🎀🎁🎗🎟🎫🎖🏆🏅🥇🥈🥉⚽️⚾️🏀🏐🏈🏉🎾🎱🎳🏏🏑🏒🏓🏸🥊🥋🥅🎯⛳🏌️♂️🏌️♀️⛸🎣🎽🎿⛷🏂🏄♂️🏄♀️🏇🏊♂️🏊♀️⛹️♂️⛹️♀️🏋️♂️🏋️♀️🚴♂️🚴♀️🚵♂️🚵♀️🏎🏍🤸♂️🤸♀️🤼♂️🤼♀️🤽♂️🤽♀️🤾♂️🤾♀️🤺🤹♂️🤹♀️🎮🕹🎲♠️♥️♦️♣️🃏🀄🎴🌍🌎🌏🌐🗺🏔⛰🌋🗻🏕🏖🏜🏝🏞🏟🏛🏗🏘🏙🏚🏠🏡🏢🏣🏤🏥🏦🏨🏩🏪🏫🏬🏭🏯🏰💒🗼🗽⛪🕌🕍⛩🕋⛲⛺🌁🌃🌄🌅🌆🌇🌉⛼♨️🌌🎠🎡🎢💈🎪🎭🖼🎨🎰🚂🚃🚄🚅🚆🚇🚈🚉🚊🚝🚞🚋🚌🚍🚎🚐🚑🚒🚓🚔🚕🚖🚗🚘🚙🚚🚛⛟🚜🚲🛴🛵🚏🛣🛤⛽🚨🚥🚦🚧🛑⚓⛵🚣♂️🚣♀️🛶🚤🛳⛴🛥🚢✈🛩🛫🛬💺🚁🚟🚠🚡🚀🛰🛎🚪🛌🛏🛋🚽🚿🛀🛁⌛⏳⌚⏰⏱⏲🕰🕛🕧🕐🕜🕑🕝🕒🕞🕓🕟🕔🕠🕕🕡🕖🕢🕗🕣🕘🕤🕙🕥🕚🕦🌑🌒🌓🌔🌕🌖🌗🌘🌙🌚🌛🌜🌡☀️🌝🌞⭐🌟🌠☁️⛅⛈🌤🌥🌦🌧🌨🌩🌪🌫🌬🌀🌈🌂☂️☔⛱⚡❄☃️⛄☄🔥💧🌊🔇🔈🔉🔊📢📣📯🔔🔕🎼🎵🎶🎙🎚🎛🎤🎧📻🎷🎸🎹🎺🎻🥁📱📲☎️📞📟📠🔋🔌💻🖥🖨⌨🖱🖲💽💾💿📀🎥🎞📽🎬📺📷📸📹📼🔍🔎🔬🔭📡🕯💡🔦🏮📔📕📖📗📘📙📚📓📒📃📜📄📰🗞📑🔖🏷💰💴💵💶💷💸💳💱💲✉📧📨📩📤📥📦📫📪📬📭📮🗳✏✒🖋🖊🖌🖍📝💼📁📂🗂📅📆🗒🗓📇📈📉📊📋📌📍📎🖇📏📐✂️🗃🗄🗑🔒🔓🔏🔐🔑🗝🔨⛏⚒🛠🗡⚔🔫🏹🛡🔧🔩⚙🗜⚗⚖🔗⛓💉💊🚬⚰⚱🗿🛢🔮🔮🏧🚮🚰♿🚹🚺🚻🚼🚾🛂🛃🛄🛅⚠️🚸⛔🚫🚳🚭🚯🚱🚷📵🔞☢☣⬆️↗️➡️↘️⬇️↙️⬅️↖️↕️↔️↩↪⤴️⤵️🔃🔄🔙🔚🔛🔜🔝🛐⚛🕉✡☸☯️☦☮🕎🔯♈♉♊♋♌♍♎♏♐♑♒♓⛎🔀🔁🔂▶️⏩⏭⏯◀️⏪⏮🔼⏫🔽⏬⏸⏹⏺⏏🎦🔅🔆📶📳📴♻️📛⚜🔰🔱⭕✅☑✔✖❌❎➕♀️♂️⚕➖➗➰➿〽✳✴❇⁉️❓❔❕❗〰🔟💯🔠🔡🔢🔣🔤🅰️🆎️🅱️🆑️🆒️🆓️ℹ🆔️Ⓜ️🆕️🆖️🅾️🆗️🅿️🆘️🆙️🆚️🈁🈂🈷🈶🈯🉐🈹🈚🈲🉑🈸🈴🈳㊗㊙🈺🈵▫️◻◼◽◾⬛⬜🔶️🔷️🔸️🔹️🔺️🔻💠🔘🔲🔳⚪⚫🔴🔵🏁🚩🏴🏳🏳️🌈⚀⚁⚂⚃⚄⚅⛾♾🇦🇨🇦🇩🇦🇪🇦🇫🇦🇬🇦🇮🇦🇱🇦🇲🇦🇴🇦🇶🇦🇷🇦🇸🇦🇹🇦🇺🇦🇼🇦🇽🇦🇿🇧🇦🇧🇧🇧🇩🇧🇪🇧🇫🇧🇬🇧🇭🇧🇮🇧🇯🇧🇱🇧🇲🇧🇳🇧🇴🇧🇶🇧🇷🇧🇸🇧🇹🇧🇼🇧🇾🇧🇿🇨🇦🇨🇨🇨🇩🇨🇫🇨🇬🇨🇭🇨🇮🇨🇰🇨🇱🇨🇲🇨🇳🇨🇴🇨🇷🇨🇺🇨🇻🇨🇼🇨🇽🇨🇾🇨🇿🇩🇪🇩🇯🇩🇰🇩🇲🇩🇴🇩🇿🇪🇨🇪🇪🇪🇬🇪🇭🇪🇷🇪🇸🇪🇹🇪🇺🇫🇮🇫🇯🇫🇰🇫🇲🇫🇴🇫🇷🇬🇦🇬🇧🇬🇩🇬🇪🇬🇫🇬🇬🇬🇭🇬🇮🇬🇱🇬🇲🇬🇳🇬🇵🇬🇶🇬🇷🇬🇸🇬🇹🇬🇺🇬🇼🇬🇾🇭🇰🇭🇲🇭🇳🇭🇷🇭🇹🇭🇺🇮🇨🇮🇩🇮🇪🇮🇱🇮🇲🇮🇳🇮🇴🇮🇶🇮🇷🇮🇸🇮🇹🇯🇪🇯🇲🇯🇴🇯🇵🇰🇪🇰🇬🇰🇭🇰🇮🇰🇲🇰🇳🇰🇵🇰🇷🇰🇼🇰🇾🇰🇿🇱🇦🇱🇧🇱🇨🇱🇮🇱🇰🇱🇷🇱🇸🇱🇹🇱🇺🇱🇻🇱🇾🇲🇦🇲🇨🇲🇩🇲🇪🇲🇬🇲🇭🇲🇰🇲🇱🇲🇲🇲🇳🇲🇴🇲🇵🇲🇶🇲🇷🇲🇸🇲🇹🇲🇺🇲🇻🇲🇼🇲🇽🇲🇾🇲🇿🇳🇦🇳🇨🇳🇪🇳🇫🇳🇬🇳🇮🇳🇱🇳🇴🇳🇵🇳🇷🇳🇺🇳🇿🇴🇲🇵🇦🇵🇪🇵🇫🇵🇬🇵🇭🇵🇰🇵🇱🇵🇲🇵🇳🇵🇷🇵🇸🇵🇹🇵🇼🇵🇾🇶🇦🇷🇪🇷🇴🇷🇸🇷🇺🇷🇼🇸🇦🇸🇧🇸🇨🇸🇩🇸🇪🇸🇬🇸🇭🇸🇮🇸🇰🇸🇱🇸🇲🇸🇳🇸🇴🇸🇷🇸🇸🇸🇹🇸🇻🇸🇽🇸🇾🇸🇿🇹🇦🇹🇨🇹🇩🇹🇫🇹🇬🇹🇭🇹🇯🇹🇰🇹🇱🇹🇲🇹🇳🇹🇴🇹🇷🇹🇹🇹🇻🇹🇼🇹🇿🇺🇦🇺🇬🇺🇳🇺🇸🇺🇾🇺🇿🇻🇦🇻🇨🇻🇪🇻🇬🇻🇮🇻🇳🇻🇺🇼🇫🇼🇸🇽🇰🇾🇪🇾🇹🇿🇦🇿🇲🇿🇼8<br/><br/><br/><br/>Sent from my Samsung Galaxy smartphone.</align>";
int font_size = 100;
void _button_clicked(void *data, Evas_Object *obj, void *event_info)
{
APP *app = data;
font_size = font_size - font_size/5;
char buffer[100] = {0};
sprintf(buffer, "DEFAULT='font=NotoColorEmoji font_size=%i color=red ellipsis=-1.0 wrap=mixed'", font_size);
Evas_Textblock_Style *style = evas_textblock_style_new();
evas_textblock_style_set(style, buffer);
evas_object_textblock_style_set(app->tb1, style);
evas_textblock_style_free(style);
sprintf(buffer, "font_size = %i",font_size);
elm_object_text_set(app->btnLoad, buffer);
style = NULL;
}
EAPI_MAIN int
elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
APP *app = calloc(1, sizeof(APP));
Evas_Object *win, *scroller1, *scroller2, *box;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_util_standard_add("", "");
elm_win_autodel_set(win, EINA_TRUE);
box = elm_box_add(win);
evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
scroller1 = elm_scroller_add(win);
evas_object_size_hint_weight_set(scroller1, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(scroller1, EVAS_HINT_FILL, EVAS_HINT_FILL);
//evas_text_cache_policy_set(EVAS_TEXT_CACHE_POLICY_TEXTURE ,EVAS_TEXT_CACHE_NONE);
app->tb1 = evas_object_textblock_add(win);
Evas_Textblock_Style *style = evas_textblock_style_new();
char buffer[100] = {0};
sprintf(buffer, "DEFAULT='font=NotoColorEmoji font_size=%i color=red ellipsis=-1.0 wrap=mixed'", font_size);
evas_textblock_style_set(style, buffer);
evas_object_textblock_style_set(app->tb1, style);
evas_textblock_style_free(style);
style = NULL;
int w,h;
evas_object_textblock_text_markup_set(app->tb1, "");
evas_object_size_hint_min_set(app->tb1, 360, 720);
elm_object_content_set(scroller1, app->tb1);
elm_box_pack_end(box, scroller1);
elm_object_content_set(win, box);
app->btnLoad = elm_button_add(win);
sprintf(buffer, "font_size = %i",font_size);
elm_object_text_set(app->btnLoad, buffer);
evas_object_smart_callback_add(app->btnLoad, "clicked", _button_clicked, app);
evas_object_show(app->btnLoad);
evas_object_move(app->btnLoad, 0, 20);
evas_object_resize(app->btnLoad, 150, 20);
evas_object_textblock_text_markup_set(app->tb1, text);
evas_object_textblock_size_formatted_get(app->tb1, &w, &h);
evas_object_size_hint_min_set(app->tb1, 800, w/800 + h + 150);
evas_object_resize(win, 800, 800);
evas_object_show(box);
evas_object_show(scroller1);
evas_object_show(scroller2);
evas_object_show(win);
elm_run();
return 0;
}
ELM_MAIN()
```
Reviewers: raster, woohyun, bu5hm4n, zmike, Hermet, segfaultxavi
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T8712
Differential Revision: https://phab.enlightenment.org/D11814
2020-05-29 02:10:28 -07:00
|
|
|
double scale_factor;
|
|
|
|
Eina_Bool is_resized;
|
2017-11-06 18:22:09 -08:00
|
|
|
int real_size;
|
|
|
|
int max_h;
|
|
|
|
int references;
|
|
|
|
int usage;
|
|
|
|
struct {
|
|
|
|
FT_Size size;
|
|
|
|
#ifdef USE_HARFBUZZ
|
|
|
|
void *hb_font;
|
|
|
|
#endif
|
|
|
|
} ft;
|
|
|
|
LK(ft_mutex);
|
|
|
|
Font_Hint_Flags hinting;
|
|
|
|
Font_Rend_Flags wanted_rend; /* The wanted rendering style */
|
|
|
|
Font_Rend_Flags runtime_rend; /* The rendering we need to do on runtime
|
|
|
|
in order to comply with the wanted_rend. */
|
|
|
|
|
|
|
|
Eina_List *task;
|
|
|
|
|
|
|
|
int generation;
|
|
|
|
|
|
|
|
Efl_Text_Font_Bitmap_Scalable bitmap_scalable;
|
|
|
|
|
|
|
|
unsigned char sizeok : 1;
|
|
|
|
unsigned char inuse : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _RGBA_Font_Source
|
|
|
|
{
|
|
|
|
const char *name;
|
|
|
|
const char *file;
|
|
|
|
void *data;
|
|
|
|
unsigned int current_size;
|
|
|
|
int data_size;
|
|
|
|
int references;
|
|
|
|
struct {
|
|
|
|
int orig_upem;
|
|
|
|
FT_Face face;
|
|
|
|
} ft;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* laziness wins for now. The parts used from the freetpye struct are
|
|
|
|
* kept intact to avoid changing the code using it until we know exactly
|
|
|
|
* what needs to be changed
|
|
|
|
*/
|
|
|
|
struct _RGBA_Font_Glyph_Out
|
|
|
|
{
|
|
|
|
unsigned char *rle;
|
|
|
|
struct {
|
|
|
|
unsigned char *buffer;
|
|
|
|
unsigned short rows;
|
|
|
|
unsigned short width;
|
|
|
|
unsigned short pitch;
|
|
|
|
unsigned short rle_alloc : 1;
|
|
|
|
unsigned short no_free_glout : 1;
|
|
|
|
} bitmap;
|
|
|
|
int rle_size;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _RGBA_Font_Glyph
|
|
|
|
{
|
|
|
|
FT_UInt index;
|
|
|
|
Evas_Coord width;
|
|
|
|
Evas_Coord x_bear;
|
|
|
|
Evas_Coord y_bear;
|
|
|
|
FT_Glyph glyph;
|
|
|
|
RGBA_Font_Glyph_Out *glyph_out;
|
2019-08-20 16:30:23 -07:00
|
|
|
void *col_dat;
|
2017-11-06 18:22:09 -08:00
|
|
|
/* this is a problem - only 1 engine at a time can extend such a font... grrr */
|
|
|
|
void *ext_dat;
|
|
|
|
void (*ext_dat_free) (void *ext_dat);
|
|
|
|
RGBA_Font_Int *fi;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2012-05-29 07:43:17 -07:00
|
|
|
/* The tangent of the slant angle we do on runtime. */
|
|
|
|
#define _EVAS_FONT_SLANT_TAN 0.221694663
|
2017-11-06 18:22:09 -08:00
|
|
|
|
2008-07-19 10:13:42 -07:00
|
|
|
/* main */
|
|
|
|
|
|
|
|
EAPI void evas_common_font_init (void);
|
|
|
|
EAPI void evas_common_font_shutdown (void);
|
2010-04-12 01:23:53 -07:00
|
|
|
EAPI void evas_common_font_font_all_unload (void);
|
2012-11-04 03:51:42 -08:00
|
|
|
|
2008-07-19 10:13:42 -07:00
|
|
|
EAPI int evas_common_font_ascent_get (RGBA_Font *fn);
|
|
|
|
EAPI int evas_common_font_descent_get (RGBA_Font *fn);
|
|
|
|
EAPI int evas_common_font_max_ascent_get (RGBA_Font *fn);
|
|
|
|
EAPI int evas_common_font_max_descent_get (RGBA_Font *fn);
|
2013-05-10 09:44:30 -07:00
|
|
|
EAPI int evas_common_font_instance_ascent_get (RGBA_Font_Int *fi);
|
|
|
|
EAPI int evas_common_font_instance_descent_get (RGBA_Font_Int *fi);
|
|
|
|
EAPI int evas_common_font_instance_max_ascent_get (RGBA_Font_Int *fi);
|
|
|
|
EAPI int evas_common_font_instance_max_descent_get (RGBA_Font_Int *fi);
|
2013-10-01 08:42:48 -07:00
|
|
|
EAPI int evas_common_font_instance_underline_position_get (RGBA_Font_Int *fi);
|
|
|
|
EAPI int evas_common_font_instance_underline_thickness_get (RGBA_Font_Int *fi);
|
2008-07-19 10:13:42 -07:00
|
|
|
EAPI int evas_common_font_get_line_advance (RGBA_Font *fn);
|
2014-02-03 05:58:25 -08:00
|
|
|
void *evas_common_font_freetype_face_get(RGBA_Font *font); /* XXX: Not EAPI on purpose. Not ment to be used in modules. */
|
2008-07-19 10:13:42 -07:00
|
|
|
|
|
|
|
EAPI RGBA_Font_Glyph *evas_common_font_int_cache_glyph_get (RGBA_Font_Int *fi, FT_UInt index);
|
2012-05-15 14:15:08 -07:00
|
|
|
EAPI Eina_Bool evas_common_font_int_cache_glyph_render(RGBA_Font_Glyph *fg);
|
evas_object_textblock: add support for variation sequences
Summary: update font processing to handle variation sequences unicodes to select proper glypg in respect to variation seqences
Test Plan:
```
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1
#include <Eina.h>
#include <Efl.h>
#include <Elementary.h>
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *win, *textblock;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_util_standard_add("Main", "");
elm_win_autodel_set(win, EINA_TRUE);
textblock = evas_object_textblock_add(win);
efl_canvas_text_style_set(textblock,NULL,"DEFAULT='font=DejaVuSans font_fallbacks=SamsungColorEmoji color=#000 font_size=20'");
evas_object_textblock_text_markup_set(textblock, "8️⃣☪️AAA☪︎1234567️⃣");
evas_object_size_hint_weight_set(textblock, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(textblock, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(textblock);
evas_object_move(textblock, 0, 0);
evas_object_resize(textblock, 320, 320);
evas_object_resize(win, 320, 320);
evas_object_show(win);
elm_run();
return 0;
}
ELM_MAIN()
```
Reviewers: woohyun, bowonryu, segfaultxavi, cedric, bu5hm4n
Reviewed By: woohyun, cedric
Subscribers: raster, bu5hm4n, subodh6129, herdsman, segfaultxavi, zmike, cedric, #committers, #reviewers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9053
2019-12-11 23:22:12 -08:00
|
|
|
EAPI FT_UInt evas_common_get_char_index (RGBA_Font_Int* fi, Eina_Unicode gl, Eina_Unicode variation_sequence);
|
2008-07-19 10:13:42 -07:00
|
|
|
|
|
|
|
/* load */
|
2017-10-11 23:15:34 -07:00
|
|
|
EAPI void evas_common_font_dpi_set (int dpi_h, int dpi_v);
|
2008-07-19 10:13:42 -07:00
|
|
|
EAPI RGBA_Font_Source *evas_common_font_source_memory_load (const char *name, const void *data, int data_size);
|
|
|
|
EAPI RGBA_Font_Source *evas_common_font_source_load (const char *name);
|
|
|
|
EAPI int evas_common_font_source_load_complete (RGBA_Font_Source *fs);
|
|
|
|
EAPI RGBA_Font_Source *evas_common_font_source_find (const char *name);
|
|
|
|
EAPI void evas_common_font_source_free (RGBA_Font_Source *fs);
|
|
|
|
EAPI void evas_common_font_size_use (RGBA_Font *fn);
|
2017-09-25 02:34:22 -07:00
|
|
|
EAPI RGBA_Font_Int *evas_common_font_int_load (const char *name, int size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
|
2008-07-19 10:13:42 -07:00
|
|
|
EAPI RGBA_Font_Int *evas_common_font_int_load_init (RGBA_Font_Int *fn);
|
|
|
|
EAPI RGBA_Font_Int *evas_common_font_int_load_complete (RGBA_Font_Int *fi);
|
2017-09-25 02:34:22 -07:00
|
|
|
EAPI RGBA_Font *evas_common_font_memory_load (const char *source, const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
|
|
|
|
EAPI RGBA_Font *evas_common_font_load (const char *name, int size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
|
|
|
|
EAPI RGBA_Font *evas_common_font_add (RGBA_Font *fn, const char *name, int size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
|
|
|
|
EAPI RGBA_Font *evas_common_font_memory_add (RGBA_Font *fn, const char *source, const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
|
2008-07-19 10:13:42 -07:00
|
|
|
EAPI void evas_common_font_free (RGBA_Font *fn);
|
2012-06-28 03:13:05 -07:00
|
|
|
EAPI void evas_common_font_int_unref (RGBA_Font_Int *fi);
|
2008-07-19 10:13:42 -07:00
|
|
|
EAPI void evas_common_font_hinting_set (RGBA_Font *fn, Font_Hint_Flags hinting);
|
2009-06-17 03:01:52 -07:00
|
|
|
EAPI Eina_Bool evas_common_hinting_available (Font_Hint_Flags hinting);
|
2017-09-25 02:34:22 -07:00
|
|
|
EAPI RGBA_Font *evas_common_font_memory_hinting_load (const char *source, const char *name, int size, const void *data, int data_size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
|
|
|
|
EAPI RGBA_Font *evas_common_font_hinting_load (const char *name, int size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
|
|
|
|
EAPI RGBA_Font *evas_common_font_hinting_add (RGBA_Font *fn, const char *name, int size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
|
|
|
|
EAPI RGBA_Font *evas_common_font_memory_hinting_add (RGBA_Font *fn, const char *source, const char *name, int size, const void *data, int data_size, Font_Hint_Flags hinting, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
|
2008-07-19 10:13:42 -07:00
|
|
|
EAPI void evas_common_font_int_modify_cache_by (RGBA_Font_Int *fi, int dir);
|
|
|
|
EAPI int evas_common_font_cache_get (void);
|
|
|
|
EAPI void evas_common_font_cache_set (int size);
|
|
|
|
EAPI void evas_common_font_flush (void);
|
|
|
|
EAPI void evas_common_font_flush_last (void);
|
2017-09-25 02:34:22 -07:00
|
|
|
EAPI RGBA_Font_Int *evas_common_font_int_find (const char *name, int size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
|
2010-08-18 08:52:16 -07:00
|
|
|
EAPI void evas_common_font_all_clear (void);
|
2016-04-11 20:47:30 -07:00
|
|
|
EAPI void evas_common_font_ext_clear (void);
|
2008-07-19 10:13:42 -07:00
|
|
|
|
|
|
|
/* query */
|
|
|
|
|
2010-08-29 05:44:58 -07:00
|
|
|
EAPI int evas_common_font_query_kerning (RGBA_Font_Int* fi, FT_UInt left, FT_UInt right, int* kerning);
|
2011-04-07 09:25:56 -07:00
|
|
|
EAPI void evas_common_font_query_size (RGBA_Font *fn, const Evas_Text_Props *intl_props, int *w, int *h);
|
2012-11-04 03:51:42 -08:00
|
|
|
EAPI int evas_common_font_query_inset (RGBA_Font *fn, const Evas_Text_Props *text_props);
|
|
|
|
EAPI int evas_common_font_query_right_inset (RGBA_Font *fn, const Evas_Text_Props *text_props);
|
2011-04-07 09:25:56 -07:00
|
|
|
EAPI void evas_common_font_query_advance (RGBA_Font *fn, const Evas_Text_Props *intl_props, int *h_adv, int *v_adv);
|
|
|
|
EAPI int evas_common_font_query_char_coords (RGBA_Font *fn, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch);
|
|
|
|
EAPI int evas_common_font_query_pen_coords (RGBA_Font *fn, const Evas_Text_Props *intl_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch);
|
|
|
|
EAPI int evas_common_font_query_char_at_coords (RGBA_Font *fn, const Evas_Text_Props *intl_props, int x, int y, int *cx, int *cy, int *cw, int *ch);
|
2017-04-09 20:15:19 -07:00
|
|
|
EAPI int evas_common_font_query_last_up_to_pos (RGBA_Font *fn, const Evas_Text_Props *intl_props, int x, int y, int width_offset);
|
2011-05-29 02:20:18 -07:00
|
|
|
EAPI int evas_common_font_query_run_font_end_get(RGBA_Font *fn, RGBA_Font_Int **script_fi, RGBA_Font_Int **cur_fi, Evas_Script_Type script, const Eina_Unicode *text, int run_len);
|
2013-02-28 07:42:35 -08:00
|
|
|
EAPI void evas_common_font_ascent_descent_get(RGBA_Font *fn, const Evas_Text_Props *text_props, int *ascent, int *descent);
|
2008-07-19 10:13:42 -07:00
|
|
|
|
2014-01-12 12:13:00 -08:00
|
|
|
EAPI void *evas_common_font_glyph_compress(void *data, int num_grays, int pixel_mode, int pitch_data, int w, int h, int *size_ret);
|
|
|
|
EAPI DATA8 *evas_common_font_glyph_uncompress(RGBA_Font_Glyph *fg, int *wret, int *hret);
|
evas_object_textblock: add support for variation sequences
Summary: update font processing to handle variation sequences unicodes to select proper glypg in respect to variation seqences
Test Plan:
```
#define EFL_EO_API_SUPPORT 1
#define EFL_BETA_API_SUPPORT 1
#include <Eina.h>
#include <Efl.h>
#include <Elementary.h>
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Evas_Object *win, *textblock;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_util_standard_add("Main", "");
elm_win_autodel_set(win, EINA_TRUE);
textblock = evas_object_textblock_add(win);
efl_canvas_text_style_set(textblock,NULL,"DEFAULT='font=DejaVuSans font_fallbacks=SamsungColorEmoji color=#000 font_size=20'");
evas_object_textblock_text_markup_set(textblock, "8️⃣☪️AAA☪︎1234567️⃣");
evas_object_size_hint_weight_set(textblock, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(textblock, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(textblock);
evas_object_move(textblock, 0, 0);
evas_object_resize(textblock, 320, 320);
evas_object_resize(win, 320, 320);
evas_object_show(win);
elm_run();
return 0;
}
ELM_MAIN()
```
Reviewers: woohyun, bowonryu, segfaultxavi, cedric, bu5hm4n
Reviewed By: woohyun, cedric
Subscribers: raster, bu5hm4n, subodh6129, herdsman, segfaultxavi, zmike, cedric, #committers, #reviewers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9053
2019-12-11 23:22:12 -08:00
|
|
|
EAPI int evas_common_font_glyph_search (RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicode gl, Eina_Unicode variation_sequence, uint32_t evas_font_search_options);
|
2014-01-12 12:13:00 -08:00
|
|
|
|
2009-06-15 08:07:13 -07:00
|
|
|
void evas_common_font_load_init(void);
|
|
|
|
void evas_common_font_load_shutdown(void);
|
|
|
|
|
2017-11-06 18:22:09 -08:00
|
|
|
void evas_font_dir_cache_free(void);
|
|
|
|
const char *evas_font_dir_cache_find(char *dir, char *font);
|
|
|
|
Eina_List *evas_font_dir_available_list(const Eina_List *font_paths);
|
|
|
|
void evas_font_dir_available_list_free(Eina_List *available);
|
|
|
|
void evas_font_free(void *font);
|
|
|
|
void evas_fonts_zero_free();
|
|
|
|
void evas_fonts_zero_pressure();
|
|
|
|
void evas_font_name_parse(Evas_Font_Description *fdesc, const char *name);
|
Efl Canvas Text : Modify Style Property
Summary:
This patch defines the way style property will work at canvas_text object
1- Changing canvas_text style property using Font/Format/Style interfaces or with efl_canvas_text style property are the same.
Example:
```
efl_text_font_set(tb, "Arial", 30);
//is same as
efl_canvas_text_style_set(tb, "font=Arial font_size=30");
//which means calling
char * font;
int size;
int font_size;
efl_text_font_get(tb, &font, &size);
// calling this after any of the top two functions will return same result
```
2- style_get_property
Will return string that contains full details about all the current applied style at canvas_text level.
3- style_set_property
Will only override passed styles and leave everything else as it is
```
efl_canvas_text_style_set(tb, "font=Arial"); // overrider font name to Arial and leave everthing else
efl_canvas_text_style_set(tb, "font_size=30"); // overrider font size to 30 and leave everthing else (font name will stay arial)
```
Reviewers: ali.alzyod, woohyun, tasn, segfaultxavi, bu5hm4n, zmike
Reviewed By: woohyun
Subscribers: zmike, bu5hm4n, segfaultxavi, a.srour, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D10607
2019-11-27 20:14:15 -08:00
|
|
|
unsigned int evas_font_style_find(const char *start, const char *end, Evas_Font_Style style);
|
|
|
|
const char *evas_font_style_find_str(int type, Evas_Font_Style style);
|
2017-11-06 18:22:09 -08:00
|
|
|
Evas_Font_Description *evas_font_desc_new(void);
|
|
|
|
Evas_Font_Description *evas_font_desc_dup(const Evas_Font_Description *fdesc);
|
|
|
|
void evas_font_desc_unref(Evas_Font_Description *fdesc);
|
|
|
|
int evas_font_desc_cmp(const Evas_Font_Description *a, const Evas_Font_Description *b);
|
|
|
|
Evas_Font_Description *evas_font_desc_ref(Evas_Font_Description *fdesc);
|
|
|
|
const char *evas_font_lang_normalize(const char *lang);
|
|
|
|
void * evas_font_load(const Eina_List *font_paths, int hinting, Evas_Font_Description *fdesc, const char *source, Evas_Font_Size size, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
|
|
|
|
void evas_font_load_hinting_set(void *font, int hinting);
|
|
|
|
|
|
|
|
#undef EAPI
|
|
|
|
#define EAPI
|
|
|
|
|
2008-07-19 10:13:42 -07:00
|
|
|
#endif /* _EVAS_FONT_H */
|