• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dict_find_string函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中dict_find_string函数的典型用法代码示例。如果您正苦于以下问题:C++ dict_find_string函数的具体用法?C++ dict_find_string怎么用?C++ dict_find_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了dict_find_string函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: zseticcspace

/*
 *   <dict>  .seticcspace  -
 *
 * Create an ICCBased color space and set it to be the current color space.
 *
 * The PostScript structure of an ICCBased color space is that same as that
 * for a CIEBased* color space:
 *
 *     [ /ICCBased <dictionary> ]
 *
 * As is the for other .setcie*space operators, the operand dictionary rather
 * than the complete color space array is on the stack when this operator
 * is inovked.
 *
 * At the time this procedure is called, the alternative color space for
 * the ICCBased color space is expected to be the current color space,
 * whether that space was explicitly specified or implied by the number
 * of components in the ICCBased color space dictionary. This is consistent
 * with the handling of alternative spaces in Separation, DeviceN, and
 * Indexed color spaces. Unlike the "zset*space" routines for those spaces,
 * however, the current code does not attempt to build the color space
 * "in place" in the graphic state.
 *
 * The procedure that invokes this operator will already have checked that
 * the operand is a dictionary, is readable, and defines the key /N
 * (number of components).
 */
static int
zseticcspace(i_ctx_t * i_ctx_p)
{
    os_ptr                  op = osp;
    int                     code;
    gs_color_space *  palt_cs;
    ref *                   pnval;
    ref *                   pstrmval;
    stream *                s;
    int                     i, ncomps;
    float                   range_buff[8];
    static const float      dflt_range[8] = { 0, 1,   0, 1,   0, 1,   0, 1 };

    code = dict_find_string(op, "N", &pnval);
    if (code < 0)
        return code;
    ncomps = pnval->value.intval;
    if (2*ncomps > sizeof(range_buff)/sizeof(range_buff[0]))
        return_error(e_rangecheck);
    /* verify the DataSource entry */
    if (dict_find_string(op, "DataSource", &pstrmval) <= 0)
        return_error(e_undefined);
    check_read_file(i_ctx_p, s, pstrmval);
    /*
     * Verify that the current color space can be a alternative color space.
     * The check for ICCBased color space is a hack to avoid introducing yet
     * another category indicator into the gs_color_space_type structur.
     */
    palt_cs = gs_currentcolorspace(igs);
    if ( !palt_cs->type->can_be_alt_space                                ||
         gs_color_space_get_index(palt_cs) == gs_color_space_index_ICC  )
        return_error(e_rangecheck);
    /*
     * Fetch and verify the Range array.
     *
     * The PDF documentation is unclear as to the purpose of this array.
     * Essentially all that is stated is that "These values must match the
     * information in the ICC profile" (PDF Reference, 2nd ed., p. 174).
     * If that is the case, why not use the information in the profile?
     * The only reason we can think of is range specification is intended
     * to be used to limit the range of values passed to the alternate
     * color space (the range may be smaller than the native range of values
     * provided by that color space).
     *
     * Because the cms code will perform normalization based on color
     * space, we use the range values only to restrict the set of input
     * values; they are not used for normalization.
     */
    code = dict_floats_param( imemory,
                              op,
                              "Range",
                              2 * ncomps,
                              range_buff,
                              dflt_range );
    for (i = 0; i < 2 * ncomps && range_buff[i + 1] >= range_buff[i]; i += 2)
        ;
    if (i != 2 * ncomps)
        return_error(e_rangecheck);
    return seticc(i_ctx_p, ncomps, op, range_buff);
}
开发者ID:hackqiang,项目名称:gs,代码行数:87,代码来源:zicc.c


示例2: dict_check_uid_param

/* Check that a UID in a dictionary is equal to an existing, valid UID. */
bool
dict_check_uid_param(const ref * pdict, const gs_uid * puid)
{
    ref *puniqueid;

    if (uid_is_XUID(puid)) {
        uint size = uid_XUID_size(puid);
        uint i;

        if (dict_find_string(pdict, "XUID", &puniqueid) <= 0)
            return false;
        if (!r_has_type(puniqueid, t_array) ||
            r_size(puniqueid) != size
            )
            return false;
        for (i = 0; i < size; i++) {
            const ref *pvalue = puniqueid->value.const_refs + i;

            if (!r_has_type(pvalue, t_integer))
                return false;
            if (pvalue->value.intval != uid_XUID_values(puid)[i])
                return false;
        }
        return true;
    } else {
        if (dict_find_string(pdict, "UniqueID", &puniqueid) <= 0)
            return false;
        return (r_has_type(puniqueid, t_integer) &&
                puniqueid->value.intval == puid->id);
    }
}
开发者ID:BorodaZizitopa,项目名称:ghostscript,代码行数:32,代码来源:idparam.c


示例3: font_with_same_UID_and_another_metrics

static int font_with_same_UID_and_another_metrics(const gs_font *pfont0, const gs_font *pfont1)
{
    const gs_font_base *pbfont0 = (const gs_font_base *)pfont0;
    const gs_font_base *pbfont1 = (const gs_font_base *)pfont1;

    if (uid_equal(&pbfont0->UID, &pbfont1->UID)) {
        const ref *pfdict0 = &pfont_data(gs_font_parent(pbfont0))->dict;
        const ref *pfdict1 = &pfont_data(gs_font_parent(pbfont1))->dict;
        ref *pmdict0, *pmdict1;

        if (pbfont0->WMode || dict_find_string(pfdict0, "Metrics", &pmdict0) <= 0)
            pmdict0 = NULL;
        if (pbfont1->WMode || dict_find_string(pfdict1, "Metrics", &pmdict1) <= 0)
            pmdict1 = NULL;
        if (!pmdict0 != !pmdict1)
            return 1;
        if (pmdict0 != NULL && !obj_eq(pfont0->memory, pmdict0, pmdict1))
            return 1;
        if (!pbfont0->WMode || dict_find_string(pfdict0, "Metrics2", &pmdict0) <= 0)
            pmdict0 = NULL;
        if (!pbfont0->WMode || dict_find_string(pfdict1, "Metrics2", &pmdict1) <= 0)
            pmdict1 = NULL;
        if (!pmdict0 != !pmdict1)
            return 1;
        if (pmdict0 != NULL && !obj_eq(pfont0->memory, pmdict0, pmdict1))
            return 1;
    }
    return 0;
}
开发者ID:BorodaZizitopa,项目名称:ghostscript,代码行数:29,代码来源:zbfont.c


示例4: build_gs_font_procs

/* Get the BuildChar and/or BuildGlyph routines from a (base) font. */
int
build_gs_font_procs(os_ptr op, build_proc_refs * pbuild)
{
    int ccode, gcode;
    ref *pBuildChar;
    ref *pBuildGlyph;

    check_type(*op, t_dictionary);
    ccode = dict_find_string(op, "BuildChar", &pBuildChar);
    gcode = dict_find_string(op, "BuildGlyph", &pBuildGlyph);
    if (ccode <= 0) {
        if (gcode <= 0)
            return_error(e_invalidfont);
        make_null(&pbuild->BuildChar);
    } else {
        check_proc(*pBuildChar);
        pbuild->BuildChar = *pBuildChar;
    }
    if (gcode <= 0)
        make_null(&pbuild->BuildGlyph);
    else {
        check_proc(*pBuildGlyph);
        pbuild->BuildGlyph = *pBuildGlyph;
    }
    return 0;
}
开发者ID:BorodaZizitopa,项目名称:ghostscript,代码行数:27,代码来源:zbfont.c


示例5: build_gs_primitive_font

/* The caller guarantees that *op is a dictionary. */
int
build_gs_primitive_font(i_ctx_t *i_ctx_p, os_ptr op, gs_font_base ** ppfont,
                        font_type ftype, gs_memory_type_ptr_t pstype,
                        const build_proc_refs * pbuild,
                        build_font_options_t options)
{
    ref *pcharstrings = 0;
    ref CharStrings;
    gs_font_base *pfont;
    font_data *pdata;
    int code;

    if (dict_find_string(op, "CharStrings", &pcharstrings) <= 0) {
        if (!(options & bf_CharStrings_optional))
            return_error(e_invalidfont);
    } else {
        ref *ignore;

        if (!r_has_type(pcharstrings, t_dictionary))
            return_error(e_invalidfont);
        if ((options & bf_notdef_required) != 0 &&
            dict_find_string(pcharstrings, ".notdef", &ignore) <= 0
            )
            return_error(e_invalidfont);
        /*
         * Since build_gs_simple_font may resize the dictionary and cause
         * pointers to become invalid, save CharStrings.
         */
        CharStrings = *pcharstrings;
    }
    code = build_gs_outline_font(i_ctx_p, op, ppfont, ftype, pstype, pbuild,
                                 options, build_gs_simple_font);
    if (code != 0)
        return code;
    pfont = *ppfont;
    pdata = pfont_data(pfont);
    if (pcharstrings)
        ref_assign(&pdata->CharStrings, &CharStrings);
    else
        make_null(&pdata->CharStrings);
    /* Check that the UniqueIDs match.  This is part of the */
    /* Adobe protection scheme, but we may as well emulate it. */
    if (uid_is_valid(&pfont->UID) &&
        !dict_check_uid_param(op, &pfont->UID)
        )
        uid_set_invalid(&pfont->UID);
    if (uid_is_valid(&pfont->UID)) {
        const gs_font *pfont0 = (const gs_font *)pfont;

        code = gs_font_find_similar(ifont_dir, &pfont0,
                       font_with_same_UID_and_another_metrics);
        if (code < 0)
            return code; /* Must not happen. */
        if (code)
            uid_set_invalid(&pfont->UID);
    }
    return 0;
}
开发者ID:BorodaZizitopa,项目名称:ghostscript,代码行数:59,代码来源:zbfont.c


示例6: zimage3

/* <dict> .image3 - */
private int
zimage3(i_ctx_t *i_ctx_p)
{
    os_ptr op = osp;
    gs_image3_t image;
    int interleave_type;
    ref *pDataDict;
    ref *pMaskDict;
    image_params ip_data, ip_mask;
    int ignored;
    int code, mcode;

    check_type(*op, t_dictionary);
    check_dict_read(*op);
    if ((code = dict_int_param(op, "InterleaveType", 1, 3, -1,
			       &interleave_type)) < 0
	)
	return code;
    gs_image3_t_init(&image, NULL, interleave_type);
    if (dict_find_string(op, "DataDict", &pDataDict) <= 0 ||
	dict_find_string(op, "MaskDict", &pMaskDict) <= 0
	)
	return_error(e_rangecheck);
    if ((code = pixel_image_params(i_ctx_p, pDataDict,
				   (gs_pixel_image_t *)&image, &ip_data,
				   12, false)) < 0 ||
	(mcode = code = data_image_params(imemory, pMaskDict, &image.MaskDict,
				   &ip_mask, false, 1, 12, false)) < 0 ||
	(code = dict_int_param(pDataDict, "ImageType", 1, 1, 0, &ignored)) < 0 ||
	(code = dict_int_param(pMaskDict, "ImageType", 1, 1, 0, &ignored)) < 0
	)
	return code;
    /*
     * MaskDict must have a DataSource iff InterleaveType == 3.
     */
    if ((ip_data.MultipleDataSources && interleave_type != 3) ||
	ip_mask.MultipleDataSources ||
	mcode != (image.InterleaveType != 3)
	)
	return_error(e_rangecheck);
    if (image.InterleaveType == 3) {
	/* Insert the mask DataSource before the data DataSources. */
	memmove(&ip_data.DataSource[1], &ip_data.DataSource[0],
		(countof(ip_data.DataSource) - 1) *
		sizeof(ip_data.DataSource[0]));
	ip_data.DataSource[0] = ip_mask.DataSource[0];
    }
    return zimage_setup(i_ctx_p, (gs_pixel_image_t *)&image,
			&ip_data.DataSource[0],
			image.CombineWithColor, 1);
}
开发者ID:99years,项目名称:plan9,代码行数:52,代码来源:zimage3.c


示例7: file_is_tempfile

/*
 * Files created with .tempfile permit some operations even if the 
 * temp directory is not explicitly named on the PermitFile... path 
 * The names 'SAFETY' and 'tempfiles' are defined by gs_init.ps
*/
static bool
file_is_tempfile(i_ctx_t *i_ctx_p, const uchar *fname, int len)
{
    ref *SAFETY;
    ref *tempfiles;
    ref kname;

    if (dict_find_string(systemdict, "SAFETY", &SAFETY) <= 0 ||
	    dict_find_string(SAFETY, "tempfiles", &tempfiles) <= 0)
	return false;
    if (name_ref(imemory, fname, len, &kname, -1) < 0 ||
	    dict_find(tempfiles, &kname, &SAFETY) <= 0)
	return false;
    return true;
}
开发者ID:MasterPlexus,项目名称:vendor_goldenve,代码行数:20,代码来源:zfile.c


示例8: font_param

/* Validate a font parameter. */
int
font_param(const ref * pfdict, gs_font ** ppfont)
{	/*
         * Check that pfdict is a read-only dictionary, that it has a FID
         * entry whose value is a fontID, and that the fontID points to a
         * gs_font structure whose associated PostScript dictionary is
         * pfdict.
         */
    ref *pid;
    gs_font *pfont;
    const font_data *pdata;

    check_type(*pfdict, t_dictionary);
    if (dict_find_string(pfdict, "FID", &pid) <= 0 ||
        !r_has_type(pid, t_fontID)
        )
        return_error(e_invalidfont);
    pfont = r_ptr(pid, gs_font);
    if (pfont == 0)
        return_error(e_invalidfont);	/* unregistered font */
    pdata = pfont->client_data;
    if (!obj_eq(pfont->memory, &pdata->dict, pfdict))
        return_error(e_invalidfont);
    *ppfont = pfont;
    return 0;
}
开发者ID:jonathan-mui,项目名称:ruby-ghostscript,代码行数:27,代码来源:zfont.c


示例9: gs_build_function_0

/* Finish building a FunctionType 0 (Sampled) function. */
int
gs_build_function_0(i_ctx_t *i_ctx_p, const ref *op, const gs_function_params_t * mnDR,
		    int depth, gs_function_t ** ppfn, gs_memory_t *mem)
{
    gs_function_Sd_params_t params;
    ref *pDataSource;
    int code;

    *(gs_function_params_t *) & params = *mnDR;
    params.Encode = 0;
    params.Decode = 0;
    params.Size = 0;
    if ((code = dict_find_string(op, "DataSource", &pDataSource)) <= 0)
	return (code < 0 ? code : gs_note_error(e_rangecheck));
    switch (r_type(pDataSource)) {
	case t_string:
	    data_source_init_string2(&params.DataSource,
				     pDataSource->value.const_bytes,
				     r_size(pDataSource));
	    break;
	case t_file: {
	    stream *s;

	    check_read_known_file_else(s, pDataSource, return_error,
				       return_error(e_invalidfileaccess));
	    if (!(s->modes & s_mode_seek))
		return_error(e_ioerror);
	    data_source_init_stream(&params.DataSource, s);
	    break;
	}
	default:
	    return_error(e_rangecheck);
    }
    if ((code = dict_int_param(op, "Order", 1, 3, 1, &params.Order)) < 0 ||
	(code = dict_int_param(op, "BitsPerSample", 1, 32, 0,
			       &params.BitsPerSample)) < 0 ||
	((code = fn_build_float_array(op, "Encode", false, true, &params.Encode, mem)) != 2 * params.m && (code != 0 || params.Encode != 0)) ||
	((code = fn_build_float_array(op, "Decode", false, true, &params.Decode, mem)) != 2 * params.n && (code != 0 || params.Decode != 0))
	) {
	goto fail;
    } {
	int *ptr = (int *)
	    gs_alloc_byte_array(mem, params.m, sizeof(int), "Size");

	if (ptr == 0) {
	    code = gs_note_error(e_VMerror);
	    goto fail;
	}
	params.Size = ptr;
	code = dict_ints_param(op, "Size", params.m, ptr);
	if (code != params.m)
	    goto fail;
    }
    code = gs_function_Sd_init(ppfn, &params, mem);
    if (code >= 0)
	return 0;
fail:
    gs_function_Sd_free_params(&params, mem);
    return (code < 0 ? code : gs_note_error(e_rangecheck));
}
开发者ID:carriercomm,项目名称:legacy,代码行数:61,代码来源:zfunc0.c


示例10: dict_float_array_check_param

/* and return maxlen. */
int
dict_float_array_check_param(const gs_memory_t *mem,
                             const ref * pdict, const char *kstr,
                             uint len, float *fvec, const float *defaultvec,
                             int under_error, int over_error)
{
    ref *pdval;
    uint size;
    int code;

    if (pdict == 0 || dict_find_string(pdict, kstr, &pdval) <= 0) {
        if (defaultvec == NULL)
            return 0;
        memcpy(fvec, defaultvec, len * sizeof(float));

        return len;
    }
    if (!r_is_array(pdval))
        return_error(e_typecheck);
    size = r_size(pdval);
    if (size > len)
        return_error(over_error);
    code = process_float_array(mem, pdval, size, fvec);
    return (code < 0 ? code :
            size == len || under_error >= 0 ? size :
            gs_note_error(under_error));
}
开发者ID:BorodaZizitopa,项目名称:ghostscript,代码行数:28,代码来源:idparam.c


示例11: dict_uint_param

/* a missing value will return e_undefined rather than 1. */
int
dict_uint_param(const ref * pdict, const char *kstr,
                uint minval, uint maxval, uint defaultval, uint * pvalue)
{
    ref *pdval;
    int code;
    uint ival;

    if (pdict == 0 || dict_find_string(pdict, kstr, &pdval) <= 0) {
        ival = defaultval;
        code = 1;
    } else {
        check_type_only(*pdval, t_integer);
        if (pdval->value.intval != (uint) pdval->value.intval)
            return_error(e_rangecheck);
        ival = (uint) pdval->value.intval;
        code = 0;
    }
    if (ival < minval || ival > maxval) {
        if (code == 1)
            return_error(e_undefined);
        else
            return_error(e_rangecheck);
    }
    *pvalue = ival;
    return code;
}
开发者ID:BorodaZizitopa,项目名称:ghostscript,代码行数:28,代码来源:idparam.c


示例12: cid_font_data_param

/* Get the additional information for a CIDFontType 0 or 2 CIDFont. */
int
cid_font_data_param(os_ptr op, gs_font_cid_data *pdata, ref *pGlyphDirectory)
{
    int code;
    ref *pgdir;

    check_type(*op, t_dictionary);
    if ((code = cid_font_system_info_param(&pdata->CIDSystemInfo, op)) < 0 ||
            (code = dict_int_param(op, "CIDCount", 0, max_int, -1,
                                   &pdata->CIDCount)) < 0
       )
        return code;
    /*
     * If the font doesn't have a GlyphDirectory, GDBytes is required.
     * If it does have a GlyphDirectory, GDBytes may still be needed for
     * CIDMap: it's up to the client to check this.
     */
    if (dict_find_string(op, "GlyphDirectory", &pgdir) <= 0) {
        /* Standard CIDFont, require GDBytes. */
        make_null(pGlyphDirectory);
        return dict_int_param(op, "GDBytes", 1, MAX_GDBytes, 0,
                              &pdata->GDBytes);
    }
    if (r_has_type(pgdir, t_dictionary) || r_is_array(pgdir)) {
        /* GlyphDirectory, GDBytes is optional. */
        *pGlyphDirectory = *pgdir;
        code = dict_int_param(op, "GDBytes", 0, MAX_GDBytes, 0,
                              &pdata->GDBytes);
        return code;
    } else {
        return_error(e_typecheck);
    }
}
开发者ID:aberg001,项目名称:plan9,代码行数:34,代码来源:zfcid.c


示例13: z_aes_d

static int
z_aes_d(i_ctx_t * i_ctx_p)
{
    os_ptr op = osp;		/* i_ctx_p->op_stack.stack.p defined in osstack.h */
    ref *sop = NULL;
    stream_aes_state state;
    int use_padding;

    /* extract the key from the parameter dictionary */
    check_type(*op, t_dictionary);
    check_dict_read(*op);
    if (dict_find_string(op, "Key", &sop) <= 0)
        return_error(gs_error_rangecheck);

    s_aes_set_key(&state, sop->value.const_bytes, r_size(sop));

    /* extract the padding flag, which defaults to true for compatibility */
    if (dict_bool_param(op, "Padding", 1, &use_padding) < 0)
        return_error(gs_error_rangecheck);

    s_aes_set_padding(&state, use_padding);

    /* we pass npop=0, since we've no arguments left to consume */
    /* FIXME: passing 0 instead of the usual rspace(sop) will allocate
       storage for filter state from the same memory pool as the stream
       it's coding. this caused no trouble when we were the arcfour cipher
       and maintained no pointers. */
    return filter_read(i_ctx_p, 0, &s_aes_template,
                       (stream_state *) & state, 0);
}
开发者ID:computersforpeace,项目名称:ghostpdl,代码行数:30,代码来源:zfaes.c


示例14: fn_build_float_array

/*
 * Collect a heap-allocated array of floats.  If the key is missing, set
 * *pparray = 0 and return 0; otherwise set *pparray and return the number
 * of elements.  Note that 0-length arrays are acceptable, so if the value
 * returned is 0, the caller must check whether *pparray == 0.
 */
int
fn_build_float_array(const ref * op, const char *kstr, bool required,
                     bool even, const float **pparray, gs_memory_t *mem)
{
    ref *par;
    int code;

    *pparray = 0;
    if (dict_find_string(op, kstr, &par) <= 0)
        return (required ? gs_note_error(gs_error_rangecheck) : 0);
    if (!r_is_array(par))
        return_error(gs_error_typecheck);
    {
        uint size = r_size(par);
        float *ptr = (float *)
            gs_alloc_byte_array(mem, size, sizeof(float), kstr);

        if (ptr == 0)
            return_error(gs_error_VMerror);
        code = dict_float_array_check_param(mem, op, kstr, size,
                                            ptr, NULL,
                                            0, gs_error_rangecheck);
        if (code < 0 || (even && (code & 1) != 0)) {
            gs_free_object(mem, ptr, kstr);
            return(code < 0 ? code : gs_note_error(gs_error_rangecheck));
        }
        *pparray = ptr;
    }
    return code;
}
开发者ID:computersforpeace,项目名称:ghostpdl,代码行数:36,代码来源:zfunc.c


示例15: z_jbig2decode

/* <source> <dict> /JBIG2Decode <file> */
static int
z_jbig2decode(i_ctx_t * i_ctx_p)
{
    os_ptr op = osp;
    ref *sop = NULL;
    s_jbig2_global_data_t *gref;
    stream_jbig2decode_state state;

    /* Extract the global context reference, if any, from the parameter
       dictionary and embed it in our stream state. The original object
       ref is under the JBIG2Globals key.
       We expect the postscript code to resolve this and call
       z_jbig2makeglobalctx() below to create an astruct wrapping the
       global decoder data and store it under the .jbig2globalctx key
     */
    s_jbig2decode_set_global_data((stream_state*)&state, NULL);
    if (r_has_type(op, t_dictionary)) {
        check_dict_read(*op);
        if ( dict_find_string(op, ".jbig2globalctx", &sop) > 0) {
            gref = r_ptr(sop, s_jbig2_global_data_t);
            s_jbig2decode_set_global_data((stream_state*)&state, gref);
        }
    }

    /* we pass npop=0, since we've no arguments left to consume */
    return filter_read(i_ctx_p, 0, &s_jbig2decode_template,
                       (stream_state *) & state, (sop ? r_space(sop) : 0));
}
开发者ID:jonathan-mui,项目名称:ruby-ghostscript,代码行数:29,代码来源:zfjbig2.c


示例16: zchar_get_CDevProc

/*
 * Get CDevProc.
 */
bool
zchar_get_CDevProc(const gs_font_base * pbfont, ref **ppcdevproc)
{
    const ref *pfdict = &pfont_data(gs_font_parent(pbfont))->dict;

    return dict_find_string(pfdict, "CDevProc", ppcdevproc) > 0;
}
开发者ID:BorodaZizitopa,项目名称:ghostscript,代码行数:10,代码来源:zcharout.c


示例17: fid_eq

/* (This is a single-use procedure, for clearer code.) */
static bool
fid_eq(const gs_memory_t *mem, const gs_font *pfont1, const gs_font *pfont2)
{
    while (pfont1->base != pfont1)
	pfont1 = pfont1->base;
    while (pfont2->base != pfont2)
	pfont2 = pfont2->base;
    if (pfont1 == pfont2)
	return true;
    switch (pfont1->FontType) {
    case 1: case 3:
	if (pfont1->FontType == pfont2->FontType)
	    break;
    default:
	return false;
    }
    /* The following, while peculiar, appears to match CPSI. */
    {
	const gs_uid *puid1 = &((const gs_font_base *)pfont1)->UID;
	const gs_uid *puid2 = &((const gs_font_base *)pfont2)->UID;
    if (uid_is_UniqueID(puid1) || uid_is_UniqueID(puid2) ||
	((uid_is_XUID(puid1) || uid_is_XUID(puid2)) &&
	 !uid_equal(puid1, puid2)))
	return false;
    }
    {
	const font_data *pfd1 = (const font_data *)pfont1->client_data;
	const font_data *pfd2 = (const font_data *)pfont2->client_data;

	if (!(obj_eq(mem, &pfd1->BuildChar, &pfd2->BuildChar) &&
	      obj_eq(mem, &pfd1->BuildGlyph, &pfd2->BuildGlyph) &&
	      obj_eq(mem, &pfd1->Encoding, &pfd2->Encoding) &&
	      obj_eq(mem, &pfd1->CharStrings, &pfd2->CharStrings)))
	    return false;
	if (pfont1->FontType == 1) {
	    ref *ppd1, *ppd2;

	    if (dict_find_string(&pfd1->dict, "Private", &ppd1) > 0 &&
		dict_find_string(&pfd2->dict, "Private", &ppd2) > 0 &&
		!obj_eq(mem, ppd1, ppd2))
		return false;
	}
    }
    return true;	    
}
开发者ID:MasterPlexus,项目名称:vendor_goldenve,代码行数:46,代码来源:iutil.c


示例18: get_GlyphNames2Unicode

void
get_GlyphNames2Unicode(i_ctx_t *i_ctx_p, gs_font *pfont, ref *pdref)
{
    ref *pfontinfo = NULL, *g2u = NULL;
    font_data *pdata;

    if (dict_find_string(pdref, "FontInfo", &pfontinfo) <= 0 ||
            !r_has_type(pfontinfo, t_dictionary) ||
            dict_find_string(pfontinfo, "GlyphNames2Unicode", &g2u) <= 0 ||
            !r_has_type(pfontinfo, t_dictionary))
        return;
    /*
     * Since build_gs_font may resize the dictionary and cause
     * pointers to become invalid, save Glyph2Unicode
     */
    pdata = pfont_data(pfont);
    ref_assign_new(&pdata->GlyphNames2Unicode, g2u);
}
开发者ID:BorodaZizitopa,项目名称:ghostscript,代码行数:18,代码来源:zbfont.c


示例19: cid_font_system_info_param

/* Get the CIDSystemInfo of a CIDFont. */
int
cid_font_system_info_param(gs_cid_system_info_t *pcidsi, const ref *prfont)
{
    ref *prcidsi;

    if (dict_find_string(prfont, "CIDSystemInfo", &prcidsi) <= 0)
        return_error(e_rangecheck);
    return cid_system_info_param(pcidsi, prcidsi);
}
开发者ID:aberg001,项目名称:plan9,代码行数:10,代码来源:zfcid.c


示例20: dict_matrix_param

/* Get a matrix from a dictionary. */
int
dict_matrix_param(const gs_memory_t *mem, const ref * pdict, const char *kstr, gs_matrix * pmat)
{
    ref *pdval;

    if (pdict == 0 || dict_find_string(pdict, kstr, &pdval) <= 0)
        return_error(e_typecheck);
    return read_matrix(mem, pdval, pmat);
}
开发者ID:BorodaZizitopa,项目名称:ghostscript,代码行数:10,代码来源:idparam.c



注:本文中的dict_find_string函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dict_free函数代码示例发布时间:2022-05-30
下一篇:
C++ dict_destroy函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap