688N/A###############################################################################
1064N/A# Copyright (c) 2009, 2011, Oracle
and/or its affiliates. All rights reserved.
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# 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# 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.
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+ /*Add for load_option*/
688N/A+ font_set->delay_loading = data->delay_loading;
688N/A+ font_set->no_checking = data->no_checking;
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)
1064N/A@@ -283,33 +288,41 @@ load_font(
688N/A if (font_set->font_name == NULL)
688N/A- if (load_fontset_data (oc, font_set) != True)
688N/A+ /* no font structure is requeried here. don't load font now. */
688N/A+ if (font_set->font == NULL) {
688N/A+ if (font_set->delay_loading) {
688N/A+ if (load_fontset_data (oc, font_set) != True)
688N/A- if(load_fontdata(oc, font_set->font_data,
688N/A- font_set->font_data_count) != True)
688N/A+ if(load_fontdata(oc, font_set->font_data,
688N/A+ font_set->font_data_count) != True)
688N/A- if(load_fontdata(oc, font_set->substitute,
688N/A- font_set->substitute_num) != True)
688N/A+ if(load_fontdata(oc, font_set->substitute,
688N/A+ font_set->substitute_num) != True)
688N/A- if (font_set->vpart_initialize == 0) {
688N/A- load_fontdata(oc, font_set->vmap, font_set->vmap_num);
688N/A- load_fontdata(oc, (FontData) font_set->vrotate,
688N/A- font_set->vrotate_num);
688N/A- font_set->vpart_initialize = 1;
688N/A+ if (font_set->vpart_initialize == 0) {
688N/A+ load_fontdata(oc, font_set->vmap, font_set->vmap_num);
688N/A+ load_fontdata(oc, (FontData) font_set->vrotate,
688N/A+ font_set->vrotate_num);
688N/A+ font_set->vpart_initialize = 1;
688N/A- if (font_set->font->min_byte1 || font_set->font->max_byte1)
688N/A- font_set->is_xchar2b = True;
688N/A- font_set->is_xchar2b = False;
688N/A+ if (font_set->font->min_byte1 || font_set->font->max_byte1)
688N/A+ font_set->is_xchar2b = True;
688N/A+ font_set->is_xchar2b = False;
1064N/A@@ -332,12 +345,24 @@ load_font_info(
688N/A if (font_set->info == NULL) {
688N/A+ /*Handle for delay loading.*/
688N/A+ if (font_set->delay_loading)
688N/A fn_list = XListFontsWithInfo(dpy, font_set->font_name, 1, &fn_num,
688N/A if (font_set->info == NULL)
688N/A+ font_set->info->fid = XLoadFont(dpy, font_set->font_name);
688N/A+ XFreeFontNames(fn_list);
688N/A XFreeFontNames(fn_list);
1064N/A@@ -453,7 +478,7 @@ init_core_part(
688N/A for ( ; font_set_num-- > 0; font_set++) {
688N/A- if (font_set->font_name == NULL)
688N/A+ if (font_set->font_name == NULL || font_set->delay_loading)/*if delay_loading, continue*/
688N/A length += strlen(font_set->font_name) + 1;
1064N/A@@ -483,7 +508,7 @@ init_core_part(
688N/A font_set_num = gen->font_set_num;
688N/A for (count = 0; font_set_num-- > 0; font_set++) {
688N/A- if (font_set->font_name == NULL)
688N/A+ if (font_set->font_name == NULL || font_set->delay_loading) /*if delay_loading, continue*/
1179N/A@@ -1163,7 +1188,7 @@ parse_fontname(
688N/A * a "missing_charset" will be reported to the client
688N/A- font_data_return. xlfd_name = NULL;
688N/A ret = parse_fontdata(oc, font_set, font_set->font_data,
1179N/A@@ -1258,7 +1283,7 @@ set_missing_list(
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) {
1179N/A@@ -1305,7 +1330,7 @@ set_missing_list(
688N/A font_set_num = gen->font_set_num;
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) {
1179N/A@@ -2089,6 +2114,20 @@ init_om(
688N/A length += strlen(data->font_data->name) + 1;
688N/A+ data->delay_loading = False;
688N/A+ data->no_checking = False;
688N/A+ _XlcGetResource(lcd, "XLC_FONTSET", buf, &value, &count);
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 /* required charset list */
1179N/Aindex ff517d5..0120c5b 100644
1064N/A@@ -326,6 +326,12 @@ load_font(
688N/A+ /* Give up displaying any characters of this missing charset. */
688N/A+ if (font_set->delay_loading == False && font_set->font!=NULL) {
688N/A+ /*In case of delay loading, load font here.*/
688N/A if (font_set->font == NULL)
1064N/A@@ -375,8 +381,10 @@ _XomConvert(
688N/A- if (font_set->font == NULL && load_font(oc, font_set) == False)
688N/A+ if (font_set->font == NULL||font_set->delay_loading){
688N/A+ if (load_font(oc, font_set) == False)
688N/A length = *to_left - cs_left;
1064N/A@@ -81,6 +81,9 @@ typedef struct _OMDataRec {
688N/A XlcCharSet *charset_list;
1064N/A@@ -120,6 +123,9 @@ typedef struct _FontSetRec {