evas_font_query: fix ARABIC HAMZA ABOVE render issue 78/266378/2
authorBowon Ryu <bowon.ryu@samsung.com>
Thu, 11 Nov 2021 07:22:35 +0000 (16:22 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Thu, 11 Nov 2021 12:09:55 +0000 (21:09 +0900)
INHERITED skip prevents ARABIC_HAMZA_ABOVE from rendering standalone.
Do not skip when ARABIC_HAMZA_ABOVE is at the begginning of an arabic word.

Change-Id: I75d5206194543031fcfe81f5ed208a8b404fc26a
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
src/lib/evas/common/evas_font.h
src/lib/evas/common/evas_font_query.c

index fd5505a..639fc49 100644 (file)
@@ -74,6 +74,8 @@ typedef unsigned long long    DATA64;
 #define  VARIATION_EMOJI_PRESENTATION  0xFE0F
 #define  VARIATION_TEXT_PRESENTATION   0xFE0E
 
+#define  ARABIC_HAMZA_ABOVE 0x0654
+
 /**
  * These Options (Flags) are used with evas_common_font_glyph_search function
  */
index a25c19c..5b1dbc9 100644 (file)
@@ -53,7 +53,20 @@ evas_common_font_query_run_font_end_get(RGBA_Font *fn, RGBA_Font_Int **script_fi
              /* Skip searching font for INHERITED script unicodes.
               * It is meaningful when only it comes after other unicodes from same font. */
              if (evas_common_language_char_script_get(*itr) == EVAS_SCRIPT_INHERITED)
-                continue;
+               {
+                  /* INHERITED skip prevents ARABIC_HAMZA_ABOVE from rendering standalone
+                   * Do not skip when ARABIC_HAMZA_ABOVE is at the begginning of an arabic word */
+                  if (*itr == ARABIC_HAMZA_ABOVE)
+                    {
+                       if (itr > text && *(itr-1) == ARABIC_HAMZA_ABOVE)
+                         continue;
+
+                       if (itr > text && evas_common_language_char_script_get(*(itr-1)) == EVAS_SCRIPT_ARABIC)
+                         continue;
+                    }
+                  else
+                    continue;
+               }
 
              variation_sequence =  VAR_SEQ_SAFE(itr+1);