From b497adb4118eae7909ac17d00fef00d7feba6bc1 Mon Sep 17 00:00:00 2001 From: Young Hahn Date: Wed, 28 May 2014 16:13:29 -0400 Subject: [PATCH] 256 char range glyphs. Refs #388. --- debug/site.js | 2 +- js/text/ranges.js | 95 ++--------------------------------------------- 2 files changed, 5 insertions(+), 92 deletions(-) diff --git a/debug/site.js b/debug/site.js index 6a222c79ff1..fcfc4aff910 100644 --- a/debug/site.js +++ b/debug/site.js @@ -12,7 +12,7 @@ if (typeof document !== 'undefined') { "mapbox streets": { type: 'vector', url: 'http://{s}.tiles.mapbox.com/v3/mapbox.mapbox-streets-v4/{z}/{x}/{y}.vector.pbf', - glyphs: 'http://mapbox.s3.amazonaws.com/gl-glyphs/{fontstack}/{range}.pbf', + glyphs: 'http://mapbox.s3.amazonaws.com/gl-glyphs-256/{fontstack}/{range}.pbf', tileSize: 512, maxZoom: 14, skipZooms: [1, 9, 11] diff --git a/js/text/ranges.js b/js/text/ranges.js index 32befc5f33b..c7ceed5783a 100644 --- a/js/text/ranges.js +++ b/js/text/ranges.js @@ -74,95 +74,8 @@ function getRanges(features, info) { codepoints: codepoints }; } - -var glyphStops = [ - 128, // Basic Latin - 256, // Latin-1 Supplement - 384, // Latin Extended-A - 592, // Latin Extended-B - 688, // IPA Extensions - 768, // Spacing Modifier Letters - 880, // Combining Diacritical Marks - 1024, // Greek - 1280, // Cyrillic - 1424, // Armenian - 1536, // Hebrew - 1792, // Arabic - 1872, // Syriac - 1984, // Thaana - 2432, // Devanagari - 2560, // Bengali - 2688, // Gurmukhi - 2816, // Gujarati - 2944, // Oriya - 3072, // Tamil - 3200, // Telugu - 3328, // Kannada - 3456, // Malayalam - 3584, // Sinhala - 3712, // Thai - 3840, // Lao - 4096, // Tibetan - 4256, // Myanmar - 4352, // Georgian - 4608, // Hangul Jamo - 4992, // Ethiopic - 5120, // Cherokee - 5760, // Unified Canadian Aboriginal Syllabics - 5792, // Ogham - 5888, // Runic - 6144, // Khmer - 6320, // Mongolian - 7936, // Latin Extended Additional - 8192, // Greek Extended - 8304, // General Punctuation - 8352, // Superscripts and Subscripts - 8400, // Currency Symbols - 8448, // Combining Marks for Symbols - 8528, // Letterlike Symbols - 8592, // Number Forms - 8704, // Arrows - 8960, // Mathematical Operators - 9216, // Miscellaneous Technical - 9280, // Control Pictures - 9312, // Optical Character Recognition - 9472, // Enclosed Alphanumerics - 9600, // Box Drawing - 9632, // Block Elements - 9728, // Geometric Shapes - 9984, // Miscellaneous Symbols - 10176, // Dingbats - 10496, // Braille Patterns - 12032, // CJK Radicals Supplement - 12256, // Kangxi Radicals - 12288, // Ideographic Description Characters - 12352, // CJK Symbols and Punctuation - 12448, // Hiragana - 12544, // Katakana - 12592, // Bopomofo - 12688, // Hangul Compatibility Jamo - 12704, // Kanbun - 12736, // Bopomofo Extended - 13056, // Enclosed CJK Letters and Months - 13312, // CJK Compatibility - 19894, // CJK Unified Ideographs Extension A - 40960, // CJK Unified Ideographs - 42128, // Yi Syllables - 42192, // Yi Radicals - 55204, // Hangul Syllables - 56192, // High Surrogates - 56320, // High Private Use Surrogates - 57344, // Low Surrogates - 63744, // Private Use - 64256, // CJK Compatibility Ideographs - 64336, // Alphabetic Presentation Forms - 65024, // Arabic Presentation Forms-A - 65072, // Combining Half Marks - 65104, // CJK Compatibility Forms - 65136, // Small Form Variants - 65279, // Arabic Presentation Forms-B - 65280, // Specials - 65520, // Halfwidth and Fullwidth Forms - 65534 // Specials -]; +var glyphStops = []; +for (var i = 0; i < (65536/256); i++) { + glyphStops[i] = Math.min((i+1) * 256, 65533); +}