Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: third_party/harfbuzz-ng/src/hb-common.cc

Issue 10510004: Roll harfbuzz-ng 3b8fd9c48f4bde368bf2d465c148b9743a9216ee (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-common.h ('k') | third_party/harfbuzz-ng/src/hb-fallback-shape.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/harfbuzz-ng/src/hb-common.cc
diff --git a/third_party/harfbuzz-ng/src/hb-common.cc b/third_party/harfbuzz-ng/src/hb-common.cc
index 6093289f54b16c70153faaec545d61325b4d2e02..bfbba65945793de324f784904e713f8520e0dbad 100644
--- a/third_party/harfbuzz-ng/src/hb-common.cc
+++ b/third_party/harfbuzz-ng/src/hb-common.cc
@@ -1,6 +1,6 @@
/*
* Copyright © 2009,2010 Red Hat, Inc.
- * Copyright © 2011 Google, Inc.
+ * Copyright © 2011,2012 Google, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
@@ -80,7 +80,7 @@ hb_direction_from_string (const char *str, int len)
char c = TOLOWER (str[0]);
for (unsigned int i = 0; i < ARRAY_LENGTH (direction_strings); i++)
if (c == direction_strings[i][0])
- return (hb_direction_t) i;
+ return (hb_direction_t) (HB_DIRECTION_LTR + i);
return HB_DIRECTION_INVALID;
}
@@ -88,8 +88,9 @@ hb_direction_from_string (const char *str, int len)
const char *
hb_direction_to_string (hb_direction_t direction)
{
- if (likely ((unsigned int) direction < ARRAY_LENGTH (direction_strings)))
- return direction_strings[direction];
+ if (likely ((unsigned int) (direction - HB_DIRECTION_LTR)
+ < ARRAY_LENGTH (direction_strings)))
+ return direction_strings[direction - HB_DIRECTION_LTR];
return "invalid";
}
@@ -264,20 +265,30 @@ hb_script_to_iso15924_tag (hb_script_t script)
hb_direction_t
hb_script_get_horizontal_direction (hb_script_t script)
{
+ /* http://goo.gl/x9ilM */
switch ((hb_tag_t) script)
{
+ /* Unicode-1.1 additions */
case HB_SCRIPT_ARABIC:
case HB_SCRIPT_HEBREW:
+
+ /* Unicode-3.0 additions */
case HB_SCRIPT_SYRIAC:
case HB_SCRIPT_THAANA:
/* Unicode-4.0 additions */
case HB_SCRIPT_CYPRIOT:
+ /* Unicode-4.1 additions */
+ case HB_SCRIPT_KHAROSHTHI:
+
/* Unicode-5.0 additions */
case HB_SCRIPT_PHOENICIAN:
case HB_SCRIPT_NKO:
+ /* Unicode-5.1 additions */
+ case HB_SCRIPT_LYDIAN:
+
/* Unicode-5.2 additions */
case HB_SCRIPT_AVESTAN:
case HB_SCRIPT_IMPERIAL_ARAMAIC:
@@ -290,6 +301,10 @@ hb_script_get_horizontal_direction (hb_script_t script)
/* Unicode-6.0 additions */
case HB_SCRIPT_MANDAIC:
+ /* Unicode-6.1 additions */
+ case HB_SCRIPT_MEROITIC_CURSIVE:
+ case HB_SCRIPT_MEROITIC_HIEROGLYPHS:
+
return HB_DIRECTION_RTL;
}
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-common.h ('k') | third_party/harfbuzz-ng/src/hb-fallback-shape.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698