The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Max value in utf-16

These changes was commited to the Birdfont repository Sun, 23 Aug 2015 17:37:30 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 23 Aug 2015 17:37:30 +0000 (19:37 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 23 Aug 2015 17:49:03 +0000 (19:49 +0200)
commit f2886eafe8c14fe60c13afac6fc5b43808f143cc
tree a291fe1990375dc10b65c03276435854e3a1b5bf
parent 9dbf6fffa1d531789628023f1c48fce229db811f
Max value in utf-16

libbirdfont/OpenFontFormat/FontData.vala
--- a/libbirdfont/OpenFontFormat/FontData.vala +++ b/libbirdfont/OpenFontFormat/FontData.vala @@ -352,7 +352,7 @@ int l = 0; while (s.get_next_char (ref index, out c)) { - if (c <= 0xFFFF - (1 << 16)) { + if (c <= 0x7FFF) { c0 = (uint8) (c >> 8); c1 = (uint8) (c - (c0 << 8)); @@ -363,7 +363,7 @@ add (c0); add (c1); } - } else if (c <= 0x423A35C7) { + } else if (c <= 0xFFFFF) { int high = (0xFFC00 & c) >> 10; int low = (0x03FF & c); @@ -397,8 +397,6 @@ l += 2; } - - assert (l == 2 * s.char_count ()); } public static uint utf16_strlen (string s) {