Commits:
-
147abd3f
by Alexei Podtelezhnikov at 2023-01-24T22:42:41-05:00
[ftgrid,ftstring,ftview] Option to select charmap by index.
* src/ftcommon.c (FTDemo_Install_Font): Accept a charmap index.
(FTDemo_Make_Encoding_Tag): Fall back on a numeric value to return.
* src/ftgrid.c, src/ftstring.c, src/ftview.c (usage): Updated.
* man/ftgrid.1, man/ftstring.1, man/ftview.1: Ditto.
7 changed files:
Changes:
man/ftgrid.1
... |
... |
@@ -73,7 +73,7 @@ Common values: |
73
|
73
|
.B ADOB
|
74
|
74
|
(Adobe standard),
|
75
|
75
|
.B ADBC
|
76
|
|
-(Adobe custom).
|
|
76
|
+(Adobe custom), or a numeric charmap index.
|
77
|
77
|
.
|
78
|
78
|
.TP
|
79
|
79
|
.BI "\-a\ \(dq" "axis1\ axis2\ .\|.\|." \(dq
|
man/ftstring.1
... |
... |
@@ -71,7 +71,7 @@ Common values: |
71
|
71
|
.B ADOB
|
72
|
72
|
(Adobe standard),
|
73
|
73
|
.B ADBC
|
74
|
|
-(Adobe custom).
|
|
74
|
+(Adobe custom), or a numeric charmap index.
|
75
|
75
|
.
|
76
|
76
|
.TP
|
77
|
77
|
.BI \-m \ text
|
man/ftview.1
... |
... |
@@ -68,7 +68,7 @@ Common values: |
68
|
68
|
.B ADOB
|
69
|
69
|
(Adobe standard),
|
70
|
70
|
.B ADBC
|
71
|
|
-(Adobe custom).
|
|
71
|
+(Adobe custom), or a numeric charmap index.
|
72
|
72
|
.
|
73
|
73
|
.TP
|
74
|
74
|
.BI \-m \ text
|
src/ftcommon.c
... |
... |
@@ -598,9 +598,10 @@ |
598
|
598
|
|
599
|
599
|
font->face_index = ( j << 16 ) + i;
|
600
|
600
|
|
601
|
|
- if ( handle-> encoding != FT_ENCODING_ORDER &&
|
602
|
|
- FT_Select_Charmap( face, (FT_Encoding)handle->encoding ) ==
|
603
|
|
- FT_Err_Ok )
|
|
601
|
+ if ( handle->encoding < face->num_charmaps )
|
|
602
|
+ font->cmap_index = handle->encoding;
|
|
603
|
+ else if ( handle->encoding != FT_ENCODING_ORDER &&
|
|
604
|
+ !FT_Select_Charmap( face, (FT_Encoding)handle->encoding ) )
|
604
|
605
|
font->cmap_index = FT_Get_Charmap_Index( face->charmap );
|
605
|
606
|
else
|
606
|
607
|
font->cmap_index = face->num_charmaps; /* FT_ENCODING_ORDER */
|
... |
... |
@@ -2038,6 +2039,10 @@ |
2038
|
2039
|
for ( i = 0; i < 4 && s[i]; i++ )
|
2039
|
2040
|
l = ( l << 8 ) | s[i];
|
2040
|
2041
|
|
|
2042
|
+ /* interpret numerically if too short for a tag */
|
|
2043
|
+ if ( i < 4 && !sscanf( s, "%lu", &l ) )
|
|
2044
|
+ l = FT_ENCODING_ORDER;
|
|
2045
|
+
|
2041
|
2046
|
return l;
|
2042
|
2047
|
}
|
2043
|
2048
|
|
src/ftgrid.c
... |
... |
@@ -1690,7 +1690,8 @@ |
1690
|
1690
|
" -f index Specify first index to display (default: 0).\n"
|
1691
|
1691
|
" -e enc Specify encoding tag (default: no encoding).\n"
|
1692
|
1692
|
" Common values: `unic' (Unicode), `symb' (symbol),\n"
|
1693
|
|
- " `ADOB' (Adobe standard), `ADBC' (Adobe custom).\n"
|
|
1693
|
+ " `ADOB' (Adobe standard), `ADBC' (Adobe custom),\n"
|
|
1694
|
+ " or a numeric charmap index.\n"
|
1694
|
1695
|
" -a \"axis1 axis2 ...\"\n"
|
1695
|
1696
|
" Specify the design coordinates for each\n"
|
1696
|
1697
|
" Multiple Master axis at start-up. Implies `-n'.\n"
|
src/ftstring.c
... |
... |
@@ -688,7 +688,8 @@ |
688
|
688
|
" -r R Use resolution R dpi (default: 72dpi).\n"
|
689
|
689
|
" -e enc Specify encoding tag (default: Unicode).\n"
|
690
|
690
|
" Common values: `unic' (Unicode), `symb' (symbol),\n"
|
691
|
|
- " `ADOB' (Adobe standard), `ADBC' (Adobe custom).\n"
|
|
691
|
+ " `ADOB' (Adobe standard), `ADBC' (Adobe custom),\n"
|
|
692
|
+ " or a numeric charmap index.\n"
|
692
|
693
|
" -m text Use `text' for rendering.\n"
|
693
|
694
|
"\n"
|
694
|
695
|
" -v Show version.\n"
|
src/ftview.c
... |
... |
@@ -1647,7 +1647,8 @@ |
1647
|
1647
|
" -f index Specify first index to display (default: 0).\n"
|
1648
|
1648
|
" -e enc Specify encoding tag (default: no encoding).\n"
|
1649
|
1649
|
" Common values: `unic' (Unicode), `symb' (symbol),\n"
|
1650
|
|
- " `ADOB' (Adobe standard), `ADBC' (Adobe custom).\n"
|
|
1650
|
+ " `ADOB' (Adobe standard), `ADBC' (Adobe custom),\n"
|
|
1651
|
+ " or a numeric charmap index.\n"
|
1651
|
1652
|
" -m text Use `text' for rendering.\n" );
|
1652
|
1653
|
fprintf( stderr,
|
1653
|
1654
|
" -l mode Set start-up rendering mode (0 <= mode <= %d).\n",
|
|