3 * Copyright 1991 by the Open Software Foundation
4 * Copyright 1993 by the TOSHIBA Corp.
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name Open Software Foundation
11 * not be used in advertising or publicity pertaining to distribution of the
12 * software without specific, written prior permission. Open Software
13 * Foundation makes no representations about the suitability of this
14 * software for any purpose. It is provided "as is" without express or
17 * OPEN SOFTWARE FOUNDATION DISCLAIMS ALL WARRANTIES WITH REGARD TO
18 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
19 * FITNESS, IN NO EVENT SHALL OPEN SOFTWARE FOUNDATIONN BE
20 * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
21 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
22 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
23 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
27 * Katsuhisa Yano TOSHIBA Corp.
32 Copyright 1991, 1998 The Open Group
34 Permission to use, copy, modify, distribute, and sell this software and its
35 documentation for any purpose is hereby granted without fee, provided that
36 the above copyright notice appear in all copies and that both that
37 copyright notice and this permission notice appear in supporting
40 The above copyright notice and this permission notice shall be included
41 in all copies or substantial portions of the Software.
43 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
44 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
45 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
46 IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
47 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
48 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
49 OTHER DEALINGS IN THE SOFTWARE.
51 Except as contained in this notice, the name of The Open Group shall
52 not be used in advertising or otherwise to promote the sale, use or
53 other dealings in this Software without prior written authorization
71 _XParseBaseFontNameList(
75 char *plist[XMAXLIST];
83 while (*str && isspace(*str))
88 if (!(ptr = strdup(str))) {
93 /* somebody who specifies more than XMAXLIST basefontnames will lose */
94 while (*num < (sizeof plist / sizeof plist[0])) {
98 if ((ptr = strchr(ptr, ','))) {
101 back = plist[*num] + strlen(plist[*num]);
103 while (isspace(*(back - 1)))
110 while (*ptr && isspace(*ptr))
115 if (!(list = (char **) Xmalloc((unsigned)sizeof(char *) * (*num + 1)))) {
117 return (char **)NULL;
119 memcpy((char *)list, (char *)plist, sizeof(char *) * (*num));
120 *(list + *num) = NULL;
130 char **string_list_ret, **list_src, **list_dst, *dst;
133 if (string_list == NULL || list_count <= 0)
134 return (char **) NULL;
136 string_list_ret = (char **) Xmalloc(sizeof(char *) * list_count);
137 if (string_list_ret == NULL)
138 return (char **) NULL;
140 list_src = string_list;
142 for (length = 0; count-- > 0; list_src++)
143 length += strlen(*list_src) + 1;
145 dst = (char *) Xmalloc(length);
147 Xfree(string_list_ret);
148 return (char **) NULL;
151 list_src = string_list;
153 list_dst = string_list_ret;
154 for ( ; count-- > 0; list_src++) {
155 strcpy(dst, *list_src);
157 dst += strlen(dst) + 1;
160 return string_list_ret;
166 _Xconst char *base_font_name_list,
167 char ***missing_charset_list,
168 int *missing_charset_count,
173 XOMCharSetList *list;
175 *missing_charset_list = NULL;
176 *missing_charset_count = 0;
178 om = XOpenOM(dpy, NULL, NULL, NULL);
180 return (XFontSet) NULL;
182 if ((oc = XCreateOC(om, XNBaseFontName, base_font_name_list, NULL))) {
183 list = &oc->core.missing_list;
184 oc->core.om_automatic = True;
186 list = &om->core.required_charset;
188 *missing_charset_list = copy_string_list(list->charset_list,
189 list->charset_count);
190 *missing_charset_count = list->charset_count;
192 if (list->charset_list && *missing_charset_list == NULL)
195 if (oc && def_string) {
196 *def_string = oc->core.default_string;
204 return (XFontSet) oc;
210 XFontStruct ***font_struct_list,
211 char ***font_name_list)
213 *font_name_list = font_set->core.font_info.font_name_list;
214 *font_struct_list = font_set->core.font_info.font_struct_list;
215 return font_set->core.font_info.num_font;
219 XBaseFontNameListOfFontSet(XFontSet font_set)
221 return font_set->core.base_name_list;
225 XLocaleOfFontSet(XFontSet font_set)
227 return font_set->core.om->core.lcd->core->name;
231 XContextDependentDrawing(XFontSet font_set)
233 return font_set->core.om->core.context_dependent;
237 XDirectionalDependentDrawing(XFontSet font_set)
239 return font_set->core.om->core.directional_dependent;
243 XContextualDrawing(XFontSet font_set)
245 return font_set->core.om->core.contextual_drawing;
249 XExtentsOfFontSet(XFontSet font_set)
253 return &font_set->core.font_set_extents;
261 XCloseOM(font_set->core.om);