688N/A###############################################################################
1370N/A# Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
688N/A#
688N/A# Permission is hereby granted, free of charge, to any person obtaining a
919N/A# copy of this software and associated documentation files (the "Software"),
919N/A# to deal in the Software without restriction, including without limitation
919N/A# the rights to use, copy, modify, merge, publish, distribute, sublicense,
919N/A# and/or sell copies of the Software, and to permit persons to whom the
919N/A# Software is furnished to do so, subject to the following conditions:
919N/A#
919N/A# The above copyright notice and this permission notice (including the next
919N/A# paragraph) shall be included in all copies or substantial portions of the
919N/A# Software.
919N/A#
919N/A# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
919N/A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
919N/A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
919N/A# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
919N/A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
919N/A# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
919N/A# DEALINGS IN THE SOFTWARE.
688N/A#
688N/A
1179N/Adiff --git a/modules/om/generic/omGeneric.c b/modules/om/generic/omGeneric.c
1370N/Aindex 64ef7b7..7b40cb1 100644
1179N/A--- a/modules/om/generic/omGeneric.c
1179N/A+++ b/modules/om/generic/omGeneric.c
1064N/A@@ -175,6 +175,11 @@ init_fontset(
688N/A if((font_set->substitute = init_fontdata(data->substitute,
688N/A data->substitute_num)) == NULL)
688N/A goto err;
688N/A+
1370N/A+ /* Add for load_option */
688N/A+ font_set->delay_loading = data->delay_loading;
688N/A+ font_set->no_checking = data->no_checking;
688N/A+
688N/A font_set->substitute_num = data->substitute_num;
688N/A if((font_set->vmap = init_fontdata(data->vmap,
688N/A data->vmap_num)) == NULL)
1370N/A@@ -283,6 +288,10 @@ load_font(
688N/A if (font_set->font_name == NULL)
688N/A continue;
688N/A
1370N/A+ /* no font structure is requeried here. don't load font now. */
1370N/A+ if ((font_set->font != NULL) || (font_set->delay_loading))
1370N/A+ continue;
688N/A+
1370N/A if (load_fontset_data (oc, font_set) != True)
1370N/A return False;
688N/A #ifndef TESTVERSION
1370N/A@@ -332,12 +341,24 @@ load_font_info(
688N/A continue;
688N/A
688N/A if (font_set->info == NULL) {
1370N/A+ /* Handle for delay loading. */
688N/A+ if (font_set->delay_loading)
688N/A+ continue;
688N/A fn_list = XListFontsWithInfo(dpy, font_set->font_name, 1, &fn_num,
688N/A &font_set->info);
688N/A if (font_set->info == NULL)
688N/A return False;
688N/A
1370N/A+#ifdef SUNSOFT
688N/A+ if (fn_num > 0) {
688N/A+ font_set->info->fid = XLoadFont(dpy, font_set->font_name);
688N/A+ }
688N/A+ if (fn_list) {
688N/A+ XFreeFontNames(fn_list);
688N/A+ }
688N/A+#else
688N/A XFreeFontNames(fn_list);
688N/A+#endif
688N/A }
688N/A }
688N/A
1370N/A@@ -453,7 +474,7 @@ init_core_part(
688N/A count = length = 0;
688N/A
688N/A for ( ; font_set_num-- > 0; font_set++) {
688N/A- if (font_set->font_name == NULL)
1370N/A+ if (font_set->font_name == NULL || font_set->delay_loading) /* if delay_loading, continue */
688N/A continue;
688N/A
688N/A length += strlen(font_set->font_name) + 1;
1370N/A@@ -483,7 +504,7 @@ init_core_part(
688N/A font_set_num = gen->font_set_num;
688N/A
688N/A for (count = 0; font_set_num-- > 0; font_set++) {
688N/A- if (font_set->font_name == NULL)
1370N/A+ if (font_set->font_name == NULL || font_set->delay_loading) /* if delay_loading, continue */
688N/A continue;
688N/A
688N/A font_set->id = count;
1370N/A@@ -1261,7 +1282,7 @@ set_missing_list(
688N/A count = length = 0;
688N/A
688N/A for ( ; font_set_num-- > 0; font_set++) {
688N/A- if (font_set->info || font_set->font) {
688N/A+ if (font_set->info || font_set->font || font_set->no_checking) {
688N/A continue;
688N/A }
688N/A
1370N/A@@ -1308,7 +1329,7 @@ set_missing_list(
688N/A font_set_num = gen->font_set_num;
688N/A
688N/A for ( ; font_set_num-- > 0; font_set++) {
688N/A- if (font_set->info || font_set->font) {
688N/A+ if (font_set->info || font_set->font || font_set->no_checking) {
688N/A continue;
688N/A }
688N/A
1370N/A@@ -2092,6 +2113,20 @@ init_om(
688N/A }
688N/A read_vw(lcd,data,num);
688N/A length += strlen(data->font_data->name) + 1;
688N/A+
688N/A+ /* For load_option */
688N/A+ data->delay_loading = False;
688N/A+ data->no_checking = False;
688N/A+ snprintf(buf, BUFSIZ, "fs%d.font.load_option", num);
688N/A+ _XlcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
688N/A+ if (count > 0) {
688N/A+ if (!strcmp(*value, "delay_check")) {
688N/A+ data->delay_loading = True;
688N/A+ } else if (!strcmp(*value, "delay_nocheck")) {
688N/A+ data->delay_loading = True;
688N/A+ data->no_checking = True;
688N/A+ }
688N/A+ }
688N/A }
688N/A
688N/A /* required charset list */
1179N/Adiff --git a/modules/om/generic/omXChar.c b/modules/om/generic/omXChar.c
1370N/Aindex c9bbb8e..4f80ce0 100644
1179N/A--- a/modules/om/generic/omXChar.c
1179N/A+++ b/modules/om/generic/omXChar.c
1370N/A@@ -285,6 +285,12 @@ load_font(
688N/A XOC oc,
688N/A FontSet font_set)
688N/A {
688N/A+ /* Give up displaying any characters of this missing charset. */
1370N/A+ if (font_set->delay_loading == False && font_set->font != NULL) {
688N/A+ return False;
688N/A+ }
688N/A+
1370N/A+ /* In case of delay loading, load font here. */
688N/A font_set->font = XLoadQueryFont(oc->core.om->core.display,
688N/A oc->core.font_info.font_name_list[font_set->id]);
688N/A if (font_set->font == NULL)
1370N/A@@ -330,8 +336,10 @@ _XomConvert(
688N/A if (font_set == NULL)
688N/A return -1;
688N/A
688N/A- if (font_set->font == NULL && load_font(oc, font_set) == False)
688N/A- return -1;
1370N/A+ if (font_set->font == NULL || font_set->delay_loading) {
688N/A+ if (load_font(oc, font_set) == False)
688N/A+ return -1;
688N/A+ }
688N/A
688N/A length = *to_left - cs_left;
688N/A
1179N/Adiff --git a/src/XomGeneric.h b/src/XomGeneric.h
1179N/Aindex d6f182d..d8eaf89 100644
1179N/A--- a/src/XomGeneric.h
1179N/A+++ b/src/XomGeneric.h
1064N/A@@ -81,6 +81,9 @@ typedef struct _OMDataRec {
688N/A XlcCharSet *charset_list;
688N/A int font_data_count;
688N/A FontData font_data;
688N/A+ /* For load_option */
688N/A+ Bool delay_loading;
688N/A+ Bool no_checking;
688N/A /* For VW/UDC */
688N/A int substitute_num;
688N/A FontData substitute;
1064N/A@@ -120,6 +123,9 @@ typedef struct _FontSetRec {
688N/A XFontStruct *font;
688N/A XlcSide side;
688N/A Bool is_xchar2b;
688N/A+ /* For load_option */
688N/A+ Bool delay_loading;
688N/A+ Bool no_checking;
688N/A /* For VW/UDC */
688N/A int substitute_num;
688N/A FontData substitute;