Clone in a terminal:
Commit 89bf577
Johan Mattsson - 2020-09-22T18:44:11+00:00
89bf57760e36c09d7305d0f946c96a5050d882cfjohan.mattsson.m@gmail.com

Fix conversion to Unicode hex code

Changed files (1)

Diff

diff --git a/libbirdfont/Font.vala b/libbirdfont/Font.valaindex 2252434..fd96ebe 100644--- a/libbirdfont/Font.vala+++ b/libbirdfont/Font.vala@@ -1206,6 +1206,7 @@ public class Font : GLib.Object {  	public static string to_hex_code (unichar ch) { 		StringBuilder s = new StringBuilder ();+		bool has_ef = false; 		 		uint8 a = (uint8)(ch & 0x00000F); 		uint8 b = (uint8)((ch & 0x0000F0) >> 4 * 1);@@ -1217,9 +1218,10 @@ public class Font : GLib.Object { 		if (e != 0 || f != 0) { 			s.append (oct_to_hex (f)); 			s.append (oct_to_hex (e));+			has_ef = true; 		} 		-		if (c != 0 || d != 0) {+		if (c != 0 || d != 0 || has_ef) { 			s.append (oct_to_hex (d)); 			s.append (oct_to_hex (c)); 		}

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112