コード例 #1
0
ファイル: write_t1.c プロジェクト: BorodaZizitopa/ghostscript
static void write_private_dictionary(FAPI_font* a_fapi_font,WRF_output* a_output, int Write_CharStrings)
        {
        a_output->m_encrypt = true;

        /* Write 4 bytes that must encrypt to at least one character that cannot be a valid hexadecimal character. */
        WRF_wstring(a_output,"XXXX");

        /*+ to do: correct size of dictionary from 8. */
        WRF_wstring(a_output,"dup /Private 8 dict dup begin\n");

        WRF_wstring(a_output,"/MinFeature {16 16} def\n");
        WRF_wstring(a_output,"/password 5839 def\n");
        if (Write_CharStrings)
            write_word_entry(a_fapi_font,a_output,"lenIV",FAPI_FONT_FEATURE_lenIV,1);
        else
            WRF_wstring(a_output,"/lenIV -1 def\n"); /* indicate that /subrs are not encoded. */
        write_word_entry(a_fapi_font,a_output,"BlueFuzz",FAPI_FONT_FEATURE_BlueFuzz,16);

        WRF_wstring(a_output,"/BlueScale ");
        WRF_wfloat(a_output,a_fapi_font->get_long(a_fapi_font,FAPI_FONT_FEATURE_BlueScale,0) / 65536.0);
        WRF_wstring(a_output," def\n");

        write_word_entry(a_fapi_font,a_output,"BlueShift",FAPI_FONT_FEATURE_BlueShift,16);
        write_array_entry(a_fapi_font,a_output,"BlueValues",FAPI_FONT_FEATURE_BlueValues,16);
        write_array_entry(a_fapi_font,a_output,"OtherBlues",FAPI_FONT_FEATURE_OtherBlues,16);
        write_array_entry(a_fapi_font,a_output,"FamilyBlues",FAPI_FONT_FEATURE_FamilyBlues,16);
        write_array_entry(a_fapi_font,a_output,"FamilyOtherBlues",FAPI_FONT_FEATURE_FamilyOtherBlues,16);
        write_word_entry(a_fapi_font,a_output,"ForceBold",FAPI_FONT_FEATURE_ForceBold,1);
        write_array_entry_with_count(a_fapi_font,a_output,"StdHW",FAPI_FONT_FEATURE_StdHW,1,16);
        write_array_entry_with_count(a_fapi_font,a_output,"StdVW",FAPI_FONT_FEATURE_StdVW,1,16);
        write_array_entry(a_fapi_font,a_output,"StemSnapH",FAPI_FONT_FEATURE_StemSnapH,16);
        write_array_entry(a_fapi_font,a_output,"StemSnapV",FAPI_FONT_FEATURE_StemSnapV,16);

        if (is_MM_font(a_fapi_font)) {
            WRF_wstring(a_output,"3 index /Blend get /Private get begin\n");
            WRF_wstring(a_output,"|-\n");
        }
        if (Write_CharStrings)
            write_subrs(a_fapi_font,a_output, 1);
        else
            write_subrs(a_fapi_font,a_output, 0);
        if (Write_CharStrings)
            write_charstrings(a_fapi_font,a_output);
        }
コード例 #2
0
ファイル: write_t1.c プロジェクト: computersforpeace/ghostpdl
static void
write_array_entry(gs_fapi_font * a_fapi_font, WRF_output * a_output,
                  const char *a_name, int a_index, int a_divisor)
{
    /* NOTE that the feature index must be preceded by the count index for this to work. */
    int count = a_fapi_font->get_word(a_fapi_font, a_index - 1, 0);

    write_array_entry_with_count(a_fapi_font, a_output, a_name, a_index,
                                 count, a_divisor);
}