hershey

package module
v0.0.0-...-daffe2c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 14 Imported by: 0

README

Hershey Fonts

Decoding and using Hershey vector fonts in Go

Current code matches this Medium article: Hershey Fonts in Go

To install:

go get github.com/exyzzy/hershey

To test & generate decoded files:

go test

For examples of:

Decoding Hershey: see generate.go

Package use: see examples.go

Quick Start

package main

import "github.com/exyzzy/hershey"

func main() {
    hershey.DrawAllFontImage()
}

Documentation

Overview

generated file, do not edit - see generate.go

generated file, do not edit - see generate.go

Index

Constants

This section is empty.

Variables

View Source
var ColorBLACK = color.RGBA{0, 0, 0, 255}
View Source
var ColorGREEN = color.RGBA{0, 255, 0, 255}
View Source
var ColorWHITE = color.RGBA{255, 255, 255, 255}
View Source
var Complex = []int{
	849, 864, 863, 925, 924, 921, 922, 901, 871, 872,
	869, 882, 861, 881, 860, 870, 850, 851, 852, 853,
	854, 855, 856, 857, 858, 859, 862, 863, 891, 888,
	892, 865, 923, 677, 678, 679, 680, 681, 682, 683,
	684, 685, 686, 687, 688, 689, 690, 691, 692, 693,
	694, 695, 696, 697, 698, 699, 700, 701, 702, 873,
	324, 874, 912, 399, 902, 754, 755, 756, 757, 758,
	759, 760, 761, 762, 763, 764, 765, 766, 767, 768,
	769, 770, 771, 772, 773, 774, 775, 776, 777, 778,
	779, 875, 879, 876, 896, 868}
View Source
var Complex_Small = []int{
	570, 585, 584, 645, 644, 641, 642, 622, 592, 593,
	590, 603, 582, 602, 581, 591, 571, 572, 573, 574,
	575, 576, 577, 578, 579, 580, 583, 584, 612, 609,
	613, 586, 643, 400, 401, 402, 403, 404, 405, 406,
	407, 408, 409, 410, 411, 412, 413, 414, 415, 416,
	417, 418, 419, 420, 421, 422, 423, 424, 425, 594,
	324, 595, 632, 398, 623, 476, 477, 478, 479, 480,
	481, 482, 483, 484, 485, 486, 487, 488, 489, 490,
	491, 492, 493, 494, 495, 496, 497, 498, 499, 500,
	501, 596, 600, 597, 617, 589}
View Source
var Cyrillic_Complex = []int{
	849, 864, 863, 925, 924, 921, 922, 901, 871, 872,
	869, 882, 861, 881, 860, 870, 850, 851, 852, 853,
	854, 855, 856, 857, 858, 859, 862, 863, 891, 888,
	892, 865, 923, 1171, 1172, 1173, 1174, 1175, 1176, 1177,
	1178, 1179, 1180, 1181, 1182, 1183, 1184, 1185, 1186, 1187,
	1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, 1196, 873,
	324, 874, 912, 399, 902, 1203, 1204, 1205, 1206, 1207,
	1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217,
	1218, 1219, 1220, 1221, 1222, 1223, 1224, 1225, 1226, 1227,
	1228, 875, 879, 876, 896, 868}
View Source
var Duplex = []int{
	1107, 1122, 1136, 925, 1127, 921, 1126, 1125, 1129, 1130,
	1131, 1133, 1119, 1132, 1118, 1128, 1108, 1109, 1110, 1111,
	1112, 1113, 1114, 1115, 1116, 1117, 1120, 1121, 891, 1134,
	892, 1123, 923, 1001, 1002, 1003, 1004, 1005, 1006, 1007,
	1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
	1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 873,
	324, 874, 912, 399, 1124, 1053, 1054, 1055, 1056, 1057,
	1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067,
	1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077,
	1078, 875, 879, 876, 896, 1137}
View Source
var Fonts = map[string][]int{"Script_Simplex": Script_Simplex,
	"Gothic_Italian_Triplex": Gothic_Italian_Triplex,
	"Cyrillic_Complex":       Cyrillic_Complex,
	"Script_Complex":         Script_Complex,
	"Symbols2":               Symbols2,
	"Symbols4":               Symbols4,
	"Duplex":                 Duplex,
	"Simplex":                Simplex,
	"Gothic_English_Triplex": Gothic_English_Triplex,
	"Greek_Complex":          Greek_Complex,
	"Greek_Complex_Small":    Greek_Complex_Small,
	"Greek_Plain":            Greek_Plain,
	"Italic_Complex":         Italic_Complex,
	"Italic_Triplex":         Italic_Triplex,
	"Symbols1":               Symbols1,
	"Italic_Complex_Small":   Italic_Complex_Small,
	"Complex":                Complex,
	"Triplex":                Triplex,
	"Gothic_German_Triplex":  Gothic_German_Triplex,
	"Greek_Simplex":          Greek_Simplex,
	"Complex_Small":          Complex_Small,
	"Plain":                  Plain,
	"Symbols3":               Symbols3,
}
View Source
var Gothic_English_Triplex = []int{
	1514, 1529, 1543, 925, 1534, 921, 1533, 1532, 1536, 1537,
	1538, 1540, 1526, 1539, 1525, 1535, 1515, 1516, 1517, 1518,
	1519, 1520, 1521, 1522, 1523, 1524, 1527, 1528, 891, 1541,
	892, 1530, 923, 1460, 1461, 1462, 1463, 1464, 1465, 1466,
	1467, 1468, 1469, 1470, 1471, 1472, 1473, 1474, 1475, 1476,
	1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, 1485, 873,
	324, 874, 912, 399, 1531, 1486, 1487, 1488, 1489, 1490,
	1491, 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500,
	1501, 1502, 1503, 1504, 1505, 1506, 1507, 1508, 1509, 1510,
	1511, 875, 879, 876, 896, 1544}
View Source
var Gothic_German_Triplex = []int{
	1514, 1529, 1543, 925, 1534, 921, 1533, 1532, 1536, 1537,
	1538, 1540, 1526, 1539, 1525, 1535, 1515, 1516, 1517, 1518,
	1519, 1520, 1521, 1522, 1523, 1524, 1527, 1528, 891, 1541,
	892, 1530, 923, 1405, 1406, 1407, 1408, 1409, 1410, 1411,
	1412, 1413, 1414, 1415, 1416, 1417, 1418, 1419, 1420, 1421,
	1422, 1423, 1424, 1425, 1426, 1427, 1428, 1429, 1430, 873,
	324, 874, 912, 399, 1531, 1431, 1432, 1433, 1434, 1435,
	1436, 1437, 1438, 1439, 1440, 1441, 1442, 1443, 1444, 1445,
	1446, 1447, 1448, 1449, 1450, 1451, 1452, 1453, 1454, 1455,
	1456, 875, 879, 876, 896, 1544}
View Source
var Gothic_Italian_Triplex = []int{
	1514, 1529, 1543, 925, 1534, 921, 1533, 1532, 1536, 1537,
	1538, 1540, 1526, 1539, 1525, 1535, 1515, 1516, 1517, 1518,
	1519, 1520, 1521, 1522, 1523, 1524, 1527, 1528, 891, 1541,
	892, 1530, 923, 1545, 1546, 1547, 1548, 1549, 1550, 1551,
	1552, 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, 1561,
	1562, 1563, 1564, 1565, 1566, 1567, 1568, 1569, 1570, 873,
	324, 874, 912, 399, 1531, 1571, 1572, 1573, 1574, 1575,
	1576, 1577, 1578, 1579, 1580, 1581, 1582, 1583, 1584, 1585,
	1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 1595,
	1596, 875, 879, 876, 896, 1544}
View Source
var Greek_Complex = []int{
	849, 864, 863, 925, 924, 921, 922, 901, 871, 872,
	869, 882, 861, 881, 860, 870, 850, 851, 852, 853,
	854, 855, 856, 857, 858, 859, 862, 863, 891, 888,
	892, 865, 923, 703, 704, 705, 706, 707, 708, 709,
	710, 711, 712, 713, 714, 715, 716, 717, 718, 719,
	720, 721, 722, 723, 724, 725, 726, 849, 849, 873,
	324, 874, 912, 399, 902, 780, 781, 782, 783, 784,
	785, 786, 787, 788, 789, 790, 791, 792, 793, 794,
	795, 796, 797, 798, 799, 800, 801, 802, 803, 849,
	849, 875, 879, 876, 896, 868}
View Source
var Greek_Complex_Small = []int{
	570, 585, 584, 645, 644, 641, 642, 622, 592, 593,
	590, 603, 582, 602, 581, 591, 571, 572, 573, 574,
	575, 576, 577, 578, 579, 580, 583, 584, 612, 609,
	613, 586, 643, 426, 427, 428, 429, 430, 431, 432,
	433, 434, 435, 436, 437, 438, 439, 440, 441, 442,
	443, 444, 445, 446, 447, 448, 449, 570, 570, 594,
	324, 595, 632, 398, 623, 502, 503, 504, 505, 506,
	507, 508, 509, 510, 511, 512, 513, 514, 515, 516,
	517, 518, 519, 520, 521, 522, 523, 524, 525, 570,
	570, 596, 600, 597, 617, 589}
View Source
var Greek_Plain = []int{
	52, 67, 70, 86, 72, 641, 87, 84, 74, 75,
	590, 78, 64, 77, 63, 73, 53, 54, 55, 56,
	57, 58, 59, 60, 61, 62, 65, 66, 612, 79,
	613, 68, 643, 26, 27, 28, 29, 30, 31, 32,
	33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
	43, 44, 45, 46, 47, 48, 49, 52, 52, 594,
	329, 595, 632, 397, 83, 26, 27, 28, 29, 30,
	31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
	41, 42, 43, 44, 45, 46, 47, 48, 49, 52,
	52, 596, 76, 597, 617, 71}
View Source
var Greek_Simplex = []int{
	250, 265, 268, 284, 270, 921, 285, 282, 272, 273,
	869, 276, 262, 275, 261, 271, 251, 252, 253, 254,
	255, 256, 257, 258, 259, 260, 263, 264, 891, 277,
	892, 266, 923, 115, 116, 117, 118, 119, 120, 121,
	122, 123, 124, 125, 126, 127, 128, 129, 130, 131,
	132, 133, 134, 135, 136, 137, 138, 250, 250, 873,
	324, 874, 912, 399, 281, 192, 193, 194, 195, 196,
	197, 198, 199, 200, 201, 202, 203, 204, 205, 206,
	207, 208, 209, 210, 211, 212, 213, 214, 215, 250,
	250, 875, 274, 876, 896, 269}
View Source
var Height = map[string][]int{"Gothic_English_Triplex": {-16, 16},
	"Gothic_Italian_Triplex": {-16, 16},
	"Greek_Simplex":          {-16, 16},
	"Italic_Complex_Small":   {-12, 12},
	"Symbols4":               {-39, 48},
	"Gothic_German_Triplex":  {-16, 16},
	"Simplex":                {-16, 16},
	"Italic_Complex":         {-16, 16},
	"Complex":                {-16, 16},
	"Triplex":                {-16, 16},
	"Script_Simplex":         {-21, 16},
	"Greek_Complex_Small":    {-12, 12},
	"Greek_Plain":            {-10, 10},
	"Italic_Triplex":         {-16, 16},
	"Cyrillic_Complex":       {-16, 19},
	"Plain":                  {-10, 10},
	"Symbols1":               {-20, 20},
	"Duplex":                 {-16, 16},
	"Symbols2":               {-41, 41},
	"Symbols3":               {-18, 24},
	"Script_Complex":         {-21, 16},
	"Greek_Complex":          {-16, 16},
	"Complex_Small":          {-12, 12},
}
View Source
var IdToIndex = map[int]int{}/* 1597 elements not displayed */
View Source
var Id_Complex = []int{
	2199, 2214, 2213, 2275, 2274, 2271, 2272, 2251, 2221, 2222,
	2219, 2232, 2211, 2231, 2210, 2220, 2200, 2201, 2202, 2203,
	2204, 2205, 2206, 2207, 2208, 2209, 2212, 2213, 2241, 2238,
	2242, 2215, 2273, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
	2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
	2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2223,
	804, 2224, 2262, 999, 2252, 2101, 2102, 2103, 2104, 2105,
	2106, 2107, 2108, 2109, 2110, 2111, 2112, 2113, 2114, 2115,
	2116, 2117, 2118, 2119, 2120, 2121, 2122, 2123, 2124, 2125,
	2126, 2225, 2229, 2226, 2246, 2218,
}
View Source
var Id_Complex_Small = []int{
	1199, 1214, 1213, 1275, 1274, 1271, 1272, 1251, 1221, 1222,
	1219, 1232, 1211, 1231, 1210, 1220, 1200, 1201, 1202, 1203,
	1204, 1205, 1206, 1207, 1208, 1209, 1212, 1213, 1241, 1238,
	1242, 1215, 1273, 1001, 1002, 1003, 1004, 1005, 1006, 1007,
	1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
	1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1223,
	804, 1224, 1262, 998, 1252, 1101, 1102, 1103, 1104, 1105,
	1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115,
	1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125,
	1126, 1225, 1229, 1226, 1246, 1218,
}
View Source
var Id_Cyrillic_Complex = []int{
	2199, 2214, 2213, 2275, 2274, 2271, 2272, 2251, 2221, 2222,
	2219, 2232, 2211, 2231, 2210, 2220, 2200, 2201, 2202, 2203,
	2204, 2205, 2206, 2207, 2208, 2209, 2212, 2213, 2241, 2238,
	2242, 2215, 2273, 2801, 2802, 2803, 2804, 2805, 2806, 2807,
	2808, 2809, 2810, 2811, 2812, 2813, 2814, 2815, 2816, 2817,
	2818, 2819, 2820, 2821, 2822, 2823, 2824, 2825, 2826, 2223,
	804, 2224, 2262, 999, 2252, 2901, 2902, 2903, 2904, 2905,
	2906, 2907, 2908, 2909, 2910, 2911, 2912, 2913, 2914, 2915,
	2916, 2917, 2918, 2919, 2920, 2921, 2922, 2923, 2924, 2925,
	2926, 2225, 2229, 2226, 2246, 2218,
}
View Source
var Id_Duplex = []int{
	2699, 2714, 2728, 2275, 2719, 2271, 2718, 2717, 2721, 2722,
	2723, 2725, 2711, 2724, 2710, 2720, 2700, 2701, 2702, 2703,
	2704, 2705, 2706, 2707, 2708, 2709, 2712, 2713, 2241, 2726,
	2242, 2715, 2273, 2501, 2502, 2503, 2504, 2505, 2506, 2507,
	2508, 2509, 2510, 2511, 2512, 2513, 2514, 2515, 2516, 2517,
	2518, 2519, 2520, 2521, 2522, 2523, 2524, 2525, 2526, 2223,
	804, 2224, 2262, 999, 2716, 2601, 2602, 2603, 2604, 2605,
	2606, 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 2615,
	2616, 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625,
	2626, 2225, 2229, 2226, 2246, 2729,
}
View Source
var Id_Fonts = map[string][]int{"Simplex": Id_Simplex,
	"Script_Simplex":         Id_Script_Simplex,
	"Gothic_English_Triplex": Id_Gothic_English_Triplex,
	"Gothic_German_Triplex":  Id_Gothic_German_Triplex,
	"Gothic_Italian_Triplex": Id_Gothic_Italian_Triplex,
	"Greek_Complex":          Id_Greek_Complex,
	"Greek_Complex_Small":    Id_Greek_Complex_Small,
	"Greek_Plain":            Id_Greek_Plain,
	"Greek_Simplex":          Id_Greek_Simplex,
	"Cyrillic_Complex":       Id_Cyrillic_Complex,
	"Italic_Complex":         Id_Italic_Complex,
	"Italic_Complex_Small":   Id_Italic_Complex_Small,
	"Italic_Triplex":         Id_Italic_Triplex,
	"Script_Complex":         Id_Script_Complex,
	"Complex":                Id_Complex,
	"Complex_Small":          Id_Complex_Small,
	"Duplex":                 Id_Duplex,
	"Plain":                  Id_Plain,
	"Triplex":                Id_Triplex,

	"Symbols1": Id_Symbols1,
	"Symbols2": Id_Symbols2,
	"Symbols3": Id_Symbols3,
	"Symbols4": Id_Symbols4,
}
View Source
var Id_Gothic_English_Triplex = []int{
	3699, 3714, 3728, 2275, 3719, 2271, 3718, 3717, 3721, 3722,
	3723, 3725, 3711, 3724, 3710, 3720, 3700, 3701, 3702, 3703,
	3704, 3705, 3706, 3707, 3708, 3709, 3712, 3713, 2241, 3726,
	2242, 3715, 2273, 3501, 3502, 3503, 3504, 3505, 3506, 3507,
	3508, 3509, 3510, 3511, 3512, 3513, 3514, 3515, 3516, 3517,
	3518, 3519, 3520, 3521, 3522, 3523, 3524, 3525, 3526, 2223,
	804, 2224, 2262, 999, 3716, 3601, 3602, 3603, 3604, 3605,
	3606, 3607, 3608, 3609, 3610, 3611, 3612, 3613, 3614, 3615,
	3616, 3617, 3618, 3619, 3620, 3621, 3622, 3623, 3624, 3625,
	3626, 2225, 2229, 2226, 2246, 3729,
}
View Source
var Id_Gothic_German_Triplex = []int{
	3699, 3714, 3728, 2275, 3719, 2271, 3718, 3717, 3721, 3722,
	3723, 3725, 3711, 3724, 3710, 3720, 3700, 3701, 3702, 3703,
	3704, 3705, 3706, 3707, 3708, 3709, 3712, 3713, 2241, 3726,
	2242, 3715, 2273, 3301, 3302, 3303, 3304, 3305, 3306, 3307,
	3308, 3309, 3310, 3311, 3312, 3313, 3314, 3315, 3316, 3317,
	3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 2223,
	804, 2224, 2262, 999, 3716, 3401, 3402, 3403, 3404, 3405,
	3406, 3407, 3408, 3409, 3410, 3411, 3412, 3413, 3414, 3415,
	3416, 3417, 3418, 3419, 3420, 3421, 3422, 3423, 3424, 3425,
	3426, 2225, 2229, 2226, 2246, 3729,
}
View Source
var Id_Gothic_Italian_Triplex = []int{
	3699, 3714, 3728, 2275, 3719, 2271, 3718, 3717, 3721, 3722,
	3723, 3725, 3711, 3724, 3710, 3720, 3700, 3701, 3702, 3703,
	3704, 3705, 3706, 3707, 3708, 3709, 3712, 3713, 2241, 3726,
	2242, 3715, 2273, 3801, 3802, 3803, 3804, 3805, 3806, 3807,
	3808, 3809, 3810, 3811, 3812, 3813, 3814, 3815, 3816, 3817,
	3818, 3819, 3820, 3821, 3822, 3823, 3824, 3825, 3826, 2223,
	804, 2224, 2262, 999, 3716, 3901, 3902, 3903, 3904, 3905,
	3906, 3907, 3908, 3909, 3910, 3911, 3912, 3913, 3914, 3915,
	3916, 3917, 3918, 3919, 3920, 3921, 3922, 3923, 3924, 3925,
	3926, 2225, 2229, 2226, 2246, 3729,
}
View Source
var Id_Greek_Complex = []int{
	2199, 2214, 2213, 2275, 2274, 2271, 2272, 2251, 2221, 2222,
	2219, 2232, 2211, 2231, 2210, 2220, 2200, 2201, 2202, 2203,
	2204, 2205, 2206, 2207, 2208, 2209, 2212, 2213, 2241, 2238,
	2242, 2215, 2273, 2027, 2028, 2029, 2030, 2031, 2032, 2033,
	2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2043,
	2044, 2045, 2046, 2047, 2048, 2049, 2050, 2199, 2199, 2223,
	804, 2224, 2262, 999, 2252, 2127, 2128, 2129, 2130, 2131,
	2132, 2133, 2134, 2135, 2136, 2137, 2138, 2139, 2140, 2141,
	2142, 2143, 2144, 2145, 2146, 2147, 2148, 2149, 2150, 2199,
	2199, 2225, 2229, 2226, 2246, 2218,
}
View Source
var Id_Greek_Complex_Small = []int{
	1199, 1214, 1213, 1275, 1274, 1271, 1272, 1251, 1221, 1222,
	1219, 1232, 1211, 1231, 1210, 1220, 1200, 1201, 1202, 1203,
	1204, 1205, 1206, 1207, 1208, 1209, 1212, 1213, 1241, 1238,
	1242, 1215, 1273, 1027, 1028, 1029, 1030, 1031, 1032, 1033,
	1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043,
	1044, 1045, 1046, 1047, 1048, 1049, 1050, 1199, 1199, 1223,
	804, 1224, 1262, 998, 1252, 1127, 1128, 1129, 1130, 1131,
	1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141,
	1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1199,
	1199, 1225, 1229, 1226, 1246, 1218,
}
View Source
var Id_Greek_Plain = []int{
	199, 214, 217, 233, 219, 1271, 234, 231, 221, 222,
	1219, 225, 211, 224, 210, 220, 200, 201, 202, 203,
	204, 205, 206, 207, 208, 209, 212, 213, 1241, 226,
	1242, 215, 1273, 27, 28, 29, 30, 31, 32, 33,
	34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
	44, 45, 46, 47, 48, 49, 50, 199, 199, 1223,
	809, 1224, 1262, 997, 230, 27, 28, 29, 30, 31,
	32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
	42, 43, 44, 45, 46, 47, 48, 49, 50, 199,
	199, 1225, 223, 1226, 1246, 218,
}
View Source
var Id_Greek_Simplex = []int{
	699, 714, 717, 733, 719, 2271, 734, 731, 721, 722,
	2219, 725, 711, 724, 710, 720, 700, 701, 702, 703,
	704, 705, 706, 707, 708, 709, 712, 713, 2241, 726,
	2242, 715, 2273, 527, 528, 529, 530, 531, 532, 533,
	534, 535, 536, 537, 538, 539, 540, 541, 542, 543,
	544, 545, 546, 547, 548, 549, 550, 699, 699, 2223,
	804, 2224, 2262, 999, 730, 627, 628, 629, 630, 631,
	632, 633, 634, 635, 636, 637, 638, 639, 640, 641,
	642, 643, 644, 645, 646, 647, 648, 649, 650, 699,
	699, 2225, 723, 2226, 2246, 718,
}
View Source
var Id_Italic_Complex = []int{
	2749, 2764, 2778, 2275, 2769, 2271, 2768, 2767, 2771, 2772,
	2773, 2775, 2761, 2774, 2760, 2770, 2750, 2751, 2752, 2753,
	2754, 2755, 2756, 2757, 2758, 2759, 2762, 2763, 2241, 2776,
	2242, 2765, 2273, 2051, 2052, 2053, 2054, 2055, 2056, 2057,
	2058, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 2067,
	2068, 2069, 2070, 2071, 2072, 2073, 2074, 2075, 2076, 2223,
	804, 2224, 2262, 999, 2766, 2151, 2152, 2153, 2154, 2155,
	2156, 2157, 2158, 2159, 2160, 2161, 2162, 2163, 2164, 2165,
	2166, 2167, 2168, 2169, 2170, 2171, 2172, 2173, 2174, 2175,
	2176, 2225, 2229, 2226, 2246, 2779,
}
View Source
var Id_Italic_Complex_Small = []int{
	1199, 1214, 1213, 1275, 1274, 1271, 1272, 1251, 1221, 1222,
	1219, 1232, 1211, 1231, 1210, 802, 1200, 1201, 1202, 1203,
	1204, 1205, 1206, 1207, 1208, 1209, 1212, 1213, 1241, 1238,
	1242, 1215, 1273, 1051, 1052, 1053, 1054, 1055, 1056, 1057,
	1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067,
	1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1223,
	804, 1224, 1262, 998, 1252, 1151, 1152, 1153, 1154, 1155,
	1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1165,
	1166, 1167, 1168, 1169, 1170, 1171, 1172, 1173, 1174, 1175,
	1176, 1225, 1229, 1226, 1246, 1218,
}
View Source
var Id_Italic_Triplex = []int{
	3249, 3264, 3278, 2275, 3269, 2271, 3268, 3267, 3271, 3272,
	3273, 3275, 3261, 3274, 3260, 3270, 3250, 3251, 3252, 3253,
	3254, 3255, 3256, 3257, 3258, 3259, 3262, 3263, 2241, 3276,
	2242, 3265, 2273, 3051, 3052, 3053, 3054, 3055, 3056, 3057,
	3058, 3059, 3060, 3061, 3062, 3063, 3064, 3065, 3066, 3067,
	3068, 3069, 3070, 3071, 3072, 3073, 3074, 3075, 3076, 2223,
	804, 2224, 2262, 999, 3266, 3151, 3152, 3153, 3154, 3155,
	3156, 3157, 3158, 3159, 3160, 3161, 3162, 3163, 3164, 3165,
	3166, 3167, 3168, 3169, 3170, 3171, 3172, 3173, 3174, 3175,
	3176, 2225, 2229, 2226, 2246, 3279,
}
View Source
var Id_Plain = []int{
	199, 214, 217, 233, 219, 1271, 234, 231, 221, 222,
	1219, 225, 211, 224, 210, 220, 200, 201, 202, 203,
	204, 205, 206, 207, 208, 209, 212, 213, 1241, 226,
	1242, 215, 1273, 1, 2, 3, 4, 5, 6, 7,
	8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
	18, 19, 20, 21, 22, 23, 24, 25, 26, 1223,
	809, 1224, 1262, 997, 230, 1, 2, 3, 4, 5,
	6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
	16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
	26, 1225, 223, 1226, 1246, 218,
}
View Source
var Id_Script_Complex = []int{
	2749, 2764, 2778, 2275, 2769, 2271, 2768, 2767, 2771, 2772,
	2773, 2775, 2761, 2774, 2760, 2770, 2750, 2751, 2752, 2753,
	2754, 2755, 2756, 2757, 2758, 2759, 2762, 2763, 2241, 2776,
	2242, 2765, 2273, 2551, 2552, 2553, 2554, 2555, 2556, 2557,
	2558, 2559, 2560, 2561, 2562, 2563, 2564, 2565, 2566, 2567,
	2568, 2569, 2570, 2571, 2572, 2573, 2574, 2575, 2576, 2223,
	804, 2224, 2262, 999, 2766, 2651, 2652, 2653, 2654, 2655,
	2656, 2657, 2658, 2659, 2660, 2661, 2662, 2663, 2664, 2665,
	2666, 2667, 2668, 2669, 2670, 2671, 2672, 2673, 2674, 2675,
	2676, 2225, 2229, 2226, 2246, 2779,
}
View Source
var Id_Script_Simplex = []int{
	699, 2764, 2778, 733, 2769, 2271, 2768, 2767, 2771, 2772,
	2773, 725, 2761, 724, 710, 2770, 2750, 2751, 2752, 2753,
	2754, 2755, 2756, 2757, 2758, 2759, 2762, 2763, 2241, 726,
	2242, 2765, 2273, 551, 552, 553, 554, 555, 556, 557,
	558, 559, 560, 561, 562, 563, 564, 565, 566, 567,
	568, 569, 570, 571, 572, 573, 574, 575, 576, 2223,
	804, 2224, 2262, 999, 2766, 651, 652, 653, 654, 655,
	656, 657, 658, 659, 660, 661, 662, 663, 664, 665,
	666, 667, 668, 669, 670, 671, 672, 673, 674, 675,
	676, 2225, 723, 2226, 2246, 718,
}
View Source
var Id_Simplex = []int{
	699, 714, 717, 733, 719, 2271, 734, 731, 721, 722,
	2219, 725, 711, 724, 710, 720, 700, 701, 702, 703,
	704, 705, 706, 707, 708, 709, 712, 713, 2241, 726,
	2242, 715, 2273, 501, 502, 503, 504, 505, 506, 507,
	508, 509, 510, 511, 512, 513, 514, 515, 516, 517,
	518, 519, 520, 521, 522, 523, 524, 525, 526, 2223,
	804, 2224, 2262, 999, 730, 601, 602, 603, 604, 605,
	606, 607, 608, 609, 610, 611, 612, 613, 614, 615,
	616, 617, 618, 619, 620, 621, 622, 623, 624, 625,
	626, 2225, 723, 2226, 2246, 718,
}
View Source
var Id_Symbols1 = []int{
	197, 198, 216, 227, 228, 229, 232, 235, 583, 677,
	683, 684, 685, 686, 687, 697, 698, 716, 727, 728,
	729, 732, 735, 737, 738, 739, 740, 741, 742, 743,
	744, 745, 746, 750, 751, 752, 753, 754, 755, 756,
	757, 758, 759, 760, 761, 762, 763, 764, 765, 766,
	767, 768, 796, 797, 798, 799, 800, 801, 803, 805,
	806, 807, 808, 810, 811, 812, 813, 814, 815, 816,
	817, 818, 819, 820, 821, 822, 823, 824, 825, 826,
	827, 828, 829, 830, 831, 832, 833, 834, 840, 841,
	842, 843, 844, 845, 846, 847,
}
View Source
var Id_Symbols2 = []int{
	850, 851, 852, 853, 854, 855, 856, 857, 860, 861,
	862, 863, 864, 865, 866, 867, 868, 869, 870, 871,
	872, 873, 874, 899, 900, 901, 902, 903, 904, 905,
	906, 907, 908, 909, 1177, 1178, 1179, 1180, 1181, 1182,
	1184, 1185, 1186, 1187, 1191, 1192, 1193, 1194, 1195, 1196,
	1197, 1198, 1216, 1217, 1227, 1228, 1230, 1233, 1234, 1235,
	1236, 1237, 1239, 1240, 1243, 1244, 1245, 1247, 1248, 1249,
	1250, 1253, 1254, 1256, 1257, 1258, 1259, 1260, 1261, 1263,
	1264, 1265, 1266, 1267, 1268, 1269, 1270, 1276, 1277, 1278,
	1279, 1281, 1282, 1283, 1284, 1285,
}
View Source
var Id_Symbols3 = []int{
	1286, 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, 1295,
	1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410,
	1411, 1412, 2077, 2177, 2178, 2179, 2180, 2181, 2182, 2184,
	2185, 2186, 2187, 2190, 2191, 2192, 2193, 2194, 2195, 2196,
	2197, 2198, 2216, 2217, 2227, 2228, 2230, 2233, 2234, 2235,
	2236, 2237, 2239, 2240, 2243, 2244, 2245, 2247, 2248, 2249,
	2250, 2253, 2254, 2255, 2256, 2257, 2258, 2259, 2260, 2261,
	2263, 2264, 2265, 2266, 2267, 2268, 2269, 2270, 2276, 2277,
	2278, 2279, 2281, 2282, 2283, 2284, 2285, 2286, 2287, 2288,
	2289, 2290, 2291, 2292, 2293, 2294,
}
View Source
var Id_Symbols4 = []int{
	2295, 2301, 2302, 2303, 2304, 2305, 2306, 2307, 2308, 2309,
	2310, 2311, 2312, 2317, 2318, 2319, 2320, 2321, 2322, 2323,
	2324, 2325, 2326, 2327, 2328, 2329, 2330, 2331, 2332, 2367,
	2368, 2369, 2370, 2371, 2372, 2373, 2374, 2375, 2376, 2377,
	2378, 2379, 2380, 2381, 2382, 2401, 2402, 2403, 2404, 2405,
	2406, 2407, 2408, 2409, 2410, 2411, 2412, 2697, 2698, 2727,
	2747, 2748, 2777, 2827, 2828, 2829, 2830, 2831, 2832, 2927,
	2928, 2929, 2930, 2931, 2932, 3197, 3198, 3227, 3247, 3248,
	3277, 3427, 3428, 3429, 3697, 3698, 3727, 197, 198, 216,
	227, 228, 229, 232, 235, 583,
}

wrap to Symbols1 to fill 96 printable chars

View Source
var Id_Triplex = []int{
	3199, 3214, 3228, 2275, 3219, 2271, 3218, 3217, 3221, 3222,
	3223, 3225, 3211, 3224, 3210, 3220, 3200, 3201, 3202, 3203,
	3204, 3205, 3206, 3207, 3208, 3209, 3212, 3213, 2241, 3226,
	2242, 3215, 2273, 3001, 3002, 3003, 3004, 3005, 3006, 3007,
	3008, 3009, 3010, 3011, 3012, 3013, 3014, 3015, 3016, 3017,
	3018, 3019, 3020, 3021, 3022, 3023, 3024, 3025, 3026, 2223,
	804, 2224, 2262, 999, 3216, 3101, 3102, 3103, 3104, 3105,
	3106, 3107, 3108, 3109, 3110, 3111, 3112, 3113, 3114, 3115,
	3116, 3117, 3118, 3119, 3120, 3121, 3122, 3123, 3124, 3125,
	3126, 2225, 2229, 2226, 2246, 3229,
}
View Source
var IndexToId = map[int]int{}/* 1597 elements not displayed */
View Source
var Italic_Complex = []int{
	1140, 1155, 1169, 925, 1160, 921, 1159, 1158, 1162, 1163,
	1164, 1166, 1152, 1165, 1151, 1161, 1141, 1142, 1143, 1144,
	1145, 1146, 1147, 1148, 1149, 1150, 1153, 1154, 891, 1167,
	892, 1156, 923, 727, 728, 729, 730, 731, 732, 733,
	734, 735, 736, 737, 738, 739, 740, 741, 742, 743,
	744, 745, 746, 747, 748, 749, 750, 751, 752, 873,
	324, 874, 912, 399, 1157, 804, 805, 806, 807, 808,
	809, 810, 811, 812, 813, 814, 815, 816, 817, 818,
	819, 820, 821, 822, 823, 824, 825, 826, 827, 828,
	829, 875, 879, 876, 896, 1170}
View Source
var Italic_Complex_Small = []int{
	570, 585, 584, 645, 644, 641, 642, 622, 592, 593,
	590, 603, 582, 602, 581, 322, 571, 572, 573, 574,
	575, 576, 577, 578, 579, 580, 583, 584, 612, 609,
	613, 586, 643, 450, 451, 452, 453, 454, 455, 456,
	457, 458, 459, 460, 461, 462, 463, 464, 465, 466,
	467, 468, 469, 470, 471, 472, 473, 474, 475, 594,
	324, 595, 632, 398, 623, 526, 527, 528, 529, 530,
	531, 532, 533, 534, 535, 536, 537, 538, 539, 540,
	541, 542, 543, 544, 545, 546, 547, 548, 549, 550,
	551, 596, 600, 597, 617, 589}
View Source
var Italic_Triplex = []int{
	1374, 1389, 1403, 925, 1394, 921, 1393, 1392, 1396, 1397,
	1398, 1400, 1386, 1399, 1385, 1395, 1375, 1376, 1377, 1378,
	1379, 1380, 1381, 1382, 1383, 1384, 1387, 1388, 891, 1401,
	892, 1390, 923, 1261, 1262, 1263, 1264, 1265, 1266, 1267,
	1268, 1269, 1270, 1271, 1272, 1273, 1274, 1275, 1276, 1277,
	1278, 1279, 1280, 1281, 1282, 1283, 1284, 1285, 1286, 873,
	324, 874, 912, 399, 1391, 1313, 1314, 1315, 1316, 1317,
	1318, 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, 1327,
	1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, 1337,
	1338, 875, 879, 876, 896, 1404}
View Source
var Plain = []int{
	52, 67, 70, 86, 72, 641, 87, 84, 74, 75,
	590, 78, 64, 77, 63, 73, 53, 54, 55, 56,
	57, 58, 59, 60, 61, 62, 65, 66, 612, 79,
	613, 68, 643, 0, 1, 2, 3, 4, 5, 6,
	7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
	17, 18, 19, 20, 21, 22, 23, 24, 25, 594,
	329, 595, 632, 397, 83, 0, 1, 2, 3, 4,
	5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
	15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
	25, 596, 76, 597, 617, 71}
View Source
var Script_Complex = []int{
	1140, 1155, 1169, 925, 1160, 921, 1159, 1158, 1162, 1163,
	1164, 1166, 1152, 1165, 1151, 1161, 1141, 1142, 1143, 1144,
	1145, 1146, 1147, 1148, 1149, 1150, 1153, 1154, 891, 1167,
	892, 1156, 923, 1027, 1028, 1029, 1030, 1031, 1032, 1033,
	1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043,
	1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 873,
	324, 874, 912, 399, 1157, 1079, 1080, 1081, 1082, 1083,
	1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093,
	1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103,
	1104, 875, 879, 876, 896, 1170}
View Source
var Script_Simplex = []int{
	250, 1155, 1169, 284, 1160, 921, 1159, 1158, 1162, 1163,
	1164, 276, 1152, 275, 261, 1161, 1141, 1142, 1143, 1144,
	1145, 1146, 1147, 1148, 1149, 1150, 1153, 1154, 891, 277,
	892, 1156, 923, 139, 140, 141, 142, 143, 144, 145,
	146, 147, 148, 149, 150, 151, 152, 153, 154, 155,
	156, 157, 158, 159, 160, 161, 162, 163, 164, 873,
	324, 874, 912, 399, 1157, 216, 217, 218, 219, 220,
	221, 222, 223, 224, 225, 226, 227, 228, 229, 230,
	231, 232, 233, 234, 235, 236, 237, 238, 239, 240,
	241, 875, 274, 876, 896, 269}
View Source
var Simplex = []int{
	250, 265, 268, 284, 270, 921, 285, 282, 272, 273,
	869, 276, 262, 275, 261, 271, 251, 252, 253, 254,
	255, 256, 257, 258, 259, 260, 263, 264, 891, 277,
	892, 266, 923, 89, 90, 91, 92, 93, 94, 95,
	96, 97, 98, 99, 100, 101, 102, 103, 104, 105,
	106, 107, 108, 109, 110, 111, 112, 113, 114, 873,
	324, 874, 912, 399, 281, 166, 167, 168, 169, 170,
	171, 172, 173, 174, 175, 176, 177, 178, 179, 180,
	181, 182, 183, 184, 185, 186, 187, 188, 189, 190,
	191, 875, 274, 876, 896, 269}
View Source
var Symbols1 = []int{
	50, 51, 69, 80, 81, 82, 85, 88, 165, 242,
	243, 244, 245, 246, 247, 248, 249, 267, 278, 279,
	280, 283, 286, 287, 288, 289, 290, 291, 292, 293,
	294, 295, 296, 297, 298, 299, 300, 301, 302, 303,
	304, 305, 306, 307, 308, 309, 310, 311, 312, 313,
	314, 315, 316, 317, 318, 319, 320, 321, 323, 325,
	326, 327, 328, 330, 331, 332, 333, 334, 335, 336,
	337, 338, 339, 340, 341, 342, 343, 344, 345, 346,
	347, 348, 349, 350, 351, 352, 353, 354, 355, 356,
	357, 358, 359, 360, 361, 362}
View Source
var Symbols2 = []int{
	363, 364, 365, 366, 367, 368, 369, 370, 371, 372,
	373, 374, 375, 376, 377, 378, 379, 380, 381, 382,
	383, 384, 385, 386, 387, 388, 389, 390, 391, 392,
	393, 394, 395, 396, 552, 553, 554, 555, 556, 557,
	558, 559, 560, 561, 562, 563, 564, 565, 566, 567,
	568, 569, 587, 588, 598, 599, 601, 604, 605, 606,
	607, 608, 610, 611, 614, 615, 616, 618, 619, 620,
	621, 624, 625, 626, 627, 628, 629, 630, 631, 633,
	634, 635, 636, 637, 638, 639, 640, 646, 647, 648,
	649, 650, 651, 652, 653, 654}
View Source
var Symbols3 = []int{
	655, 656, 657, 658, 659, 660, 661, 662, 663, 664,
	665, 666, 667, 668, 669, 670, 671, 672, 673, 674,
	675, 676, 753, 830, 831, 832, 833, 834, 835, 836,
	837, 838, 839, 840, 841, 842, 843, 844, 845, 846,
	847, 848, 866, 867, 877, 878, 880, 883, 884, 885,
	886, 887, 889, 890, 893, 894, 895, 897, 898, 899,
	900, 903, 904, 905, 906, 907, 908, 909, 910, 911,
	913, 914, 915, 916, 917, 918, 919, 920, 926, 927,
	928, 929, 930, 931, 932, 933, 934, 935, 936, 937,
	938, 939, 940, 941, 942, 943}
View Source
var Symbols4 = []int{
	944, 945, 946, 947, 948, 949, 950, 951, 952, 953,
	954, 955, 956, 957, 958, 959, 960, 961, 962, 963,
	964, 965, 966, 967, 968, 969, 970, 971, 972, 973,
	974, 975, 976, 977, 978, 979, 980, 981, 982, 983,
	984, 985, 986, 987, 988, 989, 990, 991, 992, 993,
	994, 995, 996, 997, 998, 999, 1000, 1105, 1106, 1135,
	1138, 1139, 1168, 1197, 1198, 1199, 1200, 1201, 1202, 1229,
	1230, 1231, 1232, 1233, 1234, 1339, 1340, 1369, 1372, 1373,
	1402, 1457, 1458, 1459, 1512, 1513, 1542, 50, 51, 69,
	80, 81, 82, 85, 88, 165}
View Source
var Triplex = []int{
	1341, 1356, 1370, 925, 1361, 921, 1360, 1359, 1363, 1364,
	1365, 1367, 1353, 1366, 1352, 1362, 1342, 1343, 1344, 1345,
	1346, 1347, 1348, 1349, 1350, 1351, 1354, 1355, 891, 1368,
	892, 1357, 923, 1235, 1236, 1237, 1238, 1239, 1240, 1241,
	1242, 1243, 1244, 1245, 1246, 1247, 1248, 1249, 1250, 1251,
	1252, 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, 873,
	324, 874, 912, 399, 1358, 1287, 1288, 1289, 1290, 1291,
	1292, 1293, 1294, 1295, 1296, 1297, 1298, 1299, 1300, 1301,
	1302, 1303, 1304, 1305, 1306, 1307, 1308, 1309, 1310, 1311,
	1312, 875, 879, 876, 896, 1371}

Functions

func Bounds

func Bounds(s ...interface{})

s = (haveFirst, minX, minY, maxX, maxY)

func DrawAStringLines

func DrawAStringLines() (err error)

Test function for DrawStringLinesImage

func DrawAllFontImage

func DrawAllFontImage() (err error)

Test function for DrawChar

func DrawAllFontStringImage

func DrawAllFontStringImage() (err error)

func DrawChar

func DrawChar(c rune, font string, scale int, x, y *int, fmv, fln Fn, s ...interface{}) (err error)

func DrawString

func DrawString(str string, font string, scale int, x, y *int, fmv, fln Fn, s ...interface{}) (err error)

func DrawStringLines

func DrawStringLines(str string, font string, scale int, x, y *int, lineSpace, width int, fmv, fln Fn, s ...interface{}) (err error)

func FlipV

func FlipV(img image.Image) *image.RGBA

func Generate

func Generate() (err error)

func GenerateFonts

func GenerateFonts(idToIndex map[int]int) (out string)

func GenerateHeights

func GenerateHeights() (err error)

generate min/max heights for every font into hersheyheights.go, used by DrawStringLines()

func GenerateHershey

func GenerateHershey() (out string, idToIndex map[int]int, err error)

func GenerateTranslators

func GenerateTranslators(idToIndex map[int]int) (out string)

func ImageLineTo

func ImageLineTo(s ...interface{})

s = (x2, y2, x1, y1, img, color)

func ImageMoveTo

func ImageMoveTo(s ...interface{})

s = (x2, y2, x1, y1, img, color)

func StringBounds

func StringBounds(font string, scale int, x, y int, str string) (minX, minY, maxX, maxY int, err error)

get the bounds of a string to be drawn (do not draw)

func SymbolTables

func SymbolTables(IdToIndex map[int]int)

helper function to print symbol tables for any unused chars, (already added to fontids.go)

Types

type Fn

type Fn func(s ...interface{})

type FontPath

type FontPath struct {
	Lt     int
	Rt     int
	Coords [][][]int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL