📄 cafont_load.c
字号:
{ UBYTE mem_type; UWORD mem_value;#ifdef DUMP { oprintf("DECRBMM \n"); pprint(); }#endif mem_type = MEM_BITMAP; /* set type of memory to bitmap */ mem_value = (UWORD)cp_pbuf[0];/* get parameter from buf for size of mem */ /* call the composer/ code_generator to reserve memory */ process_reserve_mem(mem_type, mem_value);}/****************************************************************************** Upload Font File Metrics*****************************************************************************/VOID dec_uffm(){#ifdef DUMP { oprintf("DECUFFM \n"); pprint(); }#endif}/****************************************************************************** Save the DCS Introducer*****************************************************************************/VOID save_dcs_introducer (){ dcs_intro.ps1 = (WORD)cp_pbuf [0]; dcs_intro.ps2 = (WORD)cp_pbuf [1]; dcs_intro.ps3 = (WORD)cp_pbuf [2];}/****************************************************************************** * initialise the command string pointer; called by LFF *****************************************************************************/VOID init_cmd_ptr() { amt_allocated = MAXFONTSIZE; /* Set True until a problem found, then set to false * Is used to tell font_dispose_of_font to add to dictionary or to * release the memory because there is a problem */ valid_load = TRUE; /* init the ptr to this memory, amt_allocated will contain amount of memory actually available */ dcs_store_ptr = FNT_GET_MEM(&amt_allocated); /* If no memory allocated, characters will merely be ignored as * they come in */ if (dcs_store_ptr == 0) { ABORT_MACRO(93); ac_dcs_ignore(); /* Set Table Ptr to DCS_IGNORE Table */ } }/* * convert character to a binary byte, for use in font names */VOID sixel_cvt_and_store (dest)UBYTE *dest;{ UBYTE sixel; sixel = cp_c; /* convert ch to a binary byte */ sixel -= 0x3f; switch (modulo) { case 0: dest [0] |= sixel << 2; break; case 1: dest [0] |= ((sixel >> 4) & 0x03); dest [1] |= ((sixel << 4) & 0xf0); break; case 2: dest [1] |= ((sixel >> 2) & 0x0f); dest [2] |= ((sixel << 6) & 0xc0); break; case 3: dest [2] |= sixel; break; } /* end switch */ modulo++; modulo &= 0x03; if (modulo == 0) { cmd_str_len += 3L; } }/****************************************************************************** dec_lff_load - load the font just received*****************************************************************************/VOID dec_lff_load(){ /* If there were any partial sixel quads received, bump up the byte * count. */ cmd_str_len += (LONG)modulo; /* Check that the new font file has something wrong with it * Analyze returns a zero if the font is ok */ if ( ANALYZE_FONT_FILE ( dcs_store_ptr, cmd_str_len) ) { ABORT_MACRO(11); /* analysis of font file turned up problem(s) */ valid_load = FALSE; /* Release the memory if analyze problems */ } FNT_DISPOSE_FONT(dcs_store_ptr, cmd_str_len, valid_load, &dll_font);}/****************************************************************************** dec_lff_enter identified, about to begin loading of CFFF *****************************************************************************/VOID dec_lff_enter(){#ifdef DUMP { oprintf("DECLFF_ENTER \n"); }#endif /* scale the summary sheet parameter */ if (dcs_intro.ps2 != 1) { dcs_intro.ps2 = 0; } /* check if need to delete all fonts */ if (dcs_intro.ps3 == 0) { FNT_DELETE_FONT_FILES (DECLFF_DELETE_ALL_DNLODED_FONTS, NULLPTR); } /* allocate memory for command string and init ptr to it */ init_cmd_ptr();}/****************************************************************************** dec_lff_term end of font file transfer *****************************************************************************/VOID dec_lff_term(){#ifdef DUMP { oprintf("DECLFF_TERM \n"); }#endif dec_lff_load(); /* font repertory has changed, so determine which font to use */ invalidate_font(); if (dcs_intro.ps2 == 0) { FNT_PRNT_STATUS_SHEET; }} /* end of dec_lff_term *//****************************************************************************** dec_lff_font - comma detected, begin next font file *****************************************************************************/VOID dec_lff_font(){#ifdef DUMP { oprintf("DECLFF_FONT \n"); }#endif /* load the font file just specified */ dec_lff_load(); /* allocate memory for command string and init ptr to it */ init_cmd_ptr();}/****************************************************************************** dec_lff_sxl identified- sixel data in font record *****************************************************************************/VOID dec_lff_sxl(){#ifdef DUMP { oprintf("DECLFF_SXL \n"); }#endif /* If no param supplied, no repeat so only perform the loop * once. Otherwise, convert the current sixel byte to binary * and store "cp_pbuf[0]" copies of it in the designated * memory location . */ if (cmd_str_len < amt_allocated) sixel_cvt_and_store (dcs_store_ptr + cmd_str_len); else /* Not enough memory was allocated, so set flag to release memory */ valid_load= FALSE;}/****************************************************************************** dec_lff_sxl_rpt identified - sixel Repeat count *****************************************************************************/VOID dec_lff_sxl_rpt(){#ifdef DUMP { oprintf("DECLFF_SXL_RPT \n"); }#endif /* If no param supplied, no repeat so only perform the loop * once. Otherwise, convert the current sixel byte to binary * and store "cp_pbuf[0]" copies of it in the designated * memory location . */ if (cp_pbuf[0] == 0) { cp_pbuf[0] = 1; } for (; ((cp_pbuf[0] >= 1) && (cmd_str_len < amt_allocated)) ; cp_pbuf[0]--) { sixel_cvt_and_store (dcs_store_ptr + cmd_str_len); } if (cmd_str_len < amt_allocated) valid_load = FALSE; /* not enough memory */}/****************************************************************************** Downline Load of Font files (LA75) *****************************************************************************/VOID dec_dld(){#ifdef DUMP { oprintf("DECDLD \n"); }#endif}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -