File: README

package info (click to toggle)
libuninameslist 20200413-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,136 kB
  • sloc: ansic: 99,746; python: 140; makefile: 112; sh: 4
file content (232 lines) | stat: -rw-r--r-- 9,634 bytes parent folder | download
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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
165
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
LibUniNamesList
***************

LibUniNamesList holds www.unicode.org Nameslist.txt data which can be useful
for programs that need Unicode "Names", "Annotations" and block definitions.


Accessing LibUniNamesList Information
*************************************

Older versions of LibUniNamesList consisted of static data arrays which can
be accessed simply as arrays. This access still exists for compatibility
with older programs that use this method. One example program using this
older method is FontForge 20120731-b. The latest version of LibUniNamesList
contains functions which help simplify access to the same data.

Functions to access data in LibUniNamesList is listed here with the oldest
listed first, and latest added function listed last. If more functions are
added, they will be added to the bottom of this list.

1) const char *uniNamesList_name(unsigned long uni);
2) const char *uniNamesList_annot(unsigned long uni);
3) const char *uniNamesList_NamesListVersion(void);
These functions are available in libuninameslist-0.4.20140731 and higher
4) int uniNamesList_blockCount(void);
5) int uniNamesList_blockNumber(unsigned long uni);
6) long uniNamesList_blockStart(int uniBlock);
7) long uniNamesList_blockEnd(int uniBlock);
8) const char *uniNamesList_blockName(int uniBlock);
These functions are available in libuninameslist-20180408 and higher
9) int uniNamesList_names2cnt(void);
10) long uniNamesList_names2val(int count);
11) int uniNamesList_names2getU(unsigned long uni);
12) int uniNamesList_names2lnC(int count);
13) int uniNamesList_names2lnU(unsigned long uni);
14) const char *uniNamesList_names2anC(int count);
15) const char *uniNamesList_names2anU(unsigned long uni);
These functions are available in libuninameslist-20200413 and higher
16) const char *uniNamesList_Languages(unsigned int lang);
17) const char *uniNamesList_NamesListVersionAlt(unsigned int lang);
18) const char *uniNamesList_nameAlt(unsigned long uni, unsigned int lang);
19) const char *uniNamesList_annotAlt(unsigned long uni, unsigned int lang);
20) int uniNamesList_nameBoth(unsigned long uni, unsigned int lang, const char **str0, const char **strl);
21) int uniNamesList_annotBoth(unsigned long uni, unsigned int lang, const char **str0, const char **str1);
22) int uniNamesList_blockCountAlt(unsigned int lang);
23) long uniNamesList_blockStartAlt(int uniBlock, unsigned int lang);
24) long uniNamesList_blockEndAlt(int uniBlock, unsigned int lang);
25) const char *uniNamesList_blockNameAlt(int uniBlock, unsigned int lang);
26) int uniNamesList_blockNumberBoth(unsigned long uni, unsigned int lang, int *bn0, int *bn1);

For a better description of each function, check "uninameslist.h", and see
an example of how to use these functions in FontForge ~ 20140101 or later.

Alternatively, look at tests/call-test.c on how to call these functions.

Building and Installing LibUniNamesList
***************************************

Read INSTALL for details on building LibUniNamesList using this package.
This package contains 2 libraries, but only 1 is built by default:
	1) libuninameslist - holds NamesList.txt data from www.unicode.org
	2) libuninameslist-fr - currently holds French 13.0 NamesList.txt
If you need the libuninameslist-fr library then you will also need to enable
building it since the current default is not to build it. This will also be
recognized in functions 16..26 listed above as lang=1 (English=default=0).
NOTE: You should run 'make clean' if you ran "./configure; make" earlier.
	$ ./configure --enable-frenchlib
	$ make clean
	$ make
	$ su
	# make install (or use 'make install-strip' for smaller libraries).
	# exit
	$

Alternatively, if you do not have autoconf or automake available with your
computer, you can fetch the configure-ready libuninameslist-dist version.


Added 'uninameslist.py' Python Wrapper
**************************************

A python wrapper is provided for users interested in libuninameslist access
using python. The easiest and simplest method for users to add it is to run
the install in two steps, first build and install libuninameslist, then use
python to install the wrapper:
	$ ./configure (may need --/prefix=/usr - use --help to see options)
	$ make clean
	$ make
	$ su
	# make install
	# cd py
	# python setup.py install
	# exit
	$

The build system can optionally also build installable wheels of the package.
To do this, pass --enable-pylib. Optionally, also set the `PYTHON` environment
variable to configure which python to use. The configured python must have pip,
setuptools and the wheel packages installed.

	$ PYTHON=python2 ./configure --enable-pylib (may need --/prefix=/usr)
	$ make
	$ su
	# make install
	# pip install py/dist/*.whl
	# exit
	$

Normally, a user default library install is made into '/usr/local', but for
some operating systems, you may need you to add '--prefix=/usr' if you will
be adding python access to uninameslist.py

This two-step install is necessary to avoid using AM_PATH_PYTHON() as part
of './configure' which interferes with installs that cannot include python.

Distro maintainers may also want to look at Adelie which has a great install:
https://code.foxkit.us/adelie/packages/blob/master/user/libuninameslist/APKBUILD


Build Process
*************

The default build process can be summarized quickly like this:

	Download LibUniNamesList*.tar.gz
	Move it somewhere appropriate (temp perhaps?) and type:
	$ tar -xzf libuninameslist*.tar.gz
	$ cd libuninameslist????????
	$ autoreconf -i
	$ automake
	$ ./configure
	$ make
	$ su
	# make install-strip
	# exit
	$

The above steps work for both release or latest versions of libuninameslist.
Release versions provided by your distro may include a configure script which
allows you to skip extra package requirements (for autotools, automake), and
you would skip steps autoreconf -i, automake above, and start at ./configure

To see what options are available before running make, type

	$ ./configure --help


NOTE: Some Distros and Operating Systems may require you to run 'ldconfig' to
recognize LibUniNamesList if you are not rebooting your computer first before
loading another program that depends on LibUniNamesList. To do this, you may
need to run 'ldconfig' in 'su -' mode after you have done 'make install':

	$ su -
	# ldconfig
	# exit
	$


How to Update LibUniNamesList (for maintainers)
***********************************************

The main purpose for LibUniNamesList is to contain a current copy of the
latest updated version of Nameslist.txt as published by www.unicode.org
which can then be accessed by users needing this information.

This means every now and then, LibUniNamesList needs to be updated with new
information. To do this, you will need to get the latest NamesList.txt file
from www.unicode.org which will then be used to build a new namelist.c file.

Let's say the next version of NamesList is version 8.0.
1) Update configure.ac with the new timestamp:
	uninameslist_package_stamp [20150701]	<-"YYYYMMDD" format
2) Update configure.ac with the new NamesList version:
	uninameslist_nameslist_ver [8.0]
3) Increment the point release, was 0.4, now becomes 0.5. NOTE: This minor
   point number may get large since LibUniNamesList is backwards compatible.
	uninameslist_major_version [0]
	uninameslist_minor_version [5]
   (if a future update of ListeDesNoms.txt >7.0 appears, then update this;
	fr_major_version [0]
	fr_minor_version [4] )
4) Update the config system, and create a versioned buildnameslist.h:
	autoreconf -i -Wall
	automake --foreign
	./configure
5) Build the buildnameslist program:
	make
6) Import "NamesList.txt" and "ListeDesNoms.txt" into the same directory:
	make NamesList.txt
	make ListeDesNoms.txt
7) Create new updated {nameslist*.c, uninameslist*.h} files:
	./buildnameslist
	make clean
	make

Added note: Going from Unicode 8.0 to 9.0, both of these libraries listed are
now bumped to 1.0 since this can be seen as a large change due to the library
compilation of the CRA being confused with Major Minor versioning.
Backwards compatibility for accessing data still remains intact for programs
that require access using older methods.
Users running older programs can recompile them to use the newer libraries or
optionally use a link pointing to the new libraries if cannot recompile them.


Adding And/Or Updating Languages (for translators)
**************************************************

If you are interested in adding a new language but don't know where to start,
then first recommendation is get a hold of the latest NamesList.txt file from
www.unicode.org and start with that first. You will want to use some sort of
plain text editor able to edit UTF-8 style files.
If you are interested in updating an existing file, there are some references
pointing to where latest NamesList style files were found, see in Makefile.am
or other nameslist*.c or uninameslist*.h for possible information if not seen
on readme files. Ask originating Authors if they want/need help if looking at
updating existing file (this is a large file, but can be done progressively).
If you are aware of translations in another format, they could be considered,
and functions 16 to 26 are available for displaying alternate languages.


Old Bugs Out, New Bugs In
*************************

If you have user type questions, a good place to look, or ask is:
	https://sourceforge.net/p/fontforge/mailman/fontforge-users/
	fontforge-devel@lists.sourceforge.net

Please report any bugs, patches and/or improvements to:
	fontforge-devel@lists.sourceforge.net

This file was last updated:
	2020-Apr-13, by Joe Da Silva