📄 caparse.c
字号:
/* * Adjust the translator's active horizontal position to reflect * the width of the char just printed */ xl_st.curchar.ap.xval += xl_st.curchar.char_data.char_width; }/*********************************************************************** a0h function *********************************************************************/VOID pr_xa0(){ WORD temp1, temp2;#ifdef DUMP { cp_exit_cur_mode(); oprintf("XA0 \n"); }#endif M$TEST_SSF(); /* Test for single shift flag */ /* * Fill in the character code of the current character */ xl_st.curchar.char_data = g_set_pointer->gset_map[cp_c7] ; /* * Fill in the rest of the fields of the current character */ xl_st.curchar.font_data = g_set_pointer->gset_fontdata ; /* If c is a space code x020, then it should be printed as a space. * * But the translation tables could have made temp1 be: * * x020 if the GL set is stored in the left half of the * PS font * * x0a0 if the GL set is stored in the right half of the * PS font * * x01d if the GL set does not exist in the proper style * * The first and last case are no problems, the second case is an issue * as the bitmap for the space is stored at x020 in the PS font. * We must therefore undo the conversion. * * If c is an x0a0, then it should be printed: * * as is x0a0, if a 96 character set is stored in GR * * as a blob x01d if a 94/95 character set is stored in GR. * * The conversion table could have made temp1 be an x020, * if the GR set is stored in the left half of the PS font. * In this case we must force temp1 to be a blob * * This is in compliance with the VSRM (referenced by the PSRM) section * 3.6.3, for the case when a character set of 94 characters is mapped * through GR. * * Modified 07/16/87 by ARAJ, to comply with memo from Tim LASKO * superseding the SRM. Now mapping a 96 char set in GL is valid */ if (cp_c == XA0) { if (!g_set_pointer->repertory ) { xl_st.curchar.char_data.char_code = VIR_CHAR_BLOB; } } /* Check the active position of the outgoing character */ M$CHECK_AP ( -(xl_st.curchar.font_data.above_baseline_offset+1), xl_st.curchar.font_data.below_baseline_offset ); /* If justifying, add current char to justify buffer */ if (xl_st.justify_mode) { add_to_jfy_buf (&xl_st.curchar); } /* If not justifying, AND the right margin flag is set, * do not output the character; otherwise, dispose of it. */ else { if (xl_st.rmf) { return; } process_char (&xl_st.curchar); } /* * Adjust the translator's active horizontal position to reflect * the width of the char just printed */ xl_st.curchar.ap.xval += xl_st.curchar.char_data.char_width; cp_exit_cur_mode(); }/*********************************************************************** FFh function *********************************************************************/VOID pr_xff(){ WORD temp1, temp2;#ifdef DUMP { cp_exit_cur_mode(); oprintf("XFF \n"); }#endif M$TEST_SSF(); /* Test for single shift flag */ if ( (cp_c7 == DEL) && (!g_set_pointer->repertory) ) /* -> 94 character set */ { return; /* i.e., NOP */ } /* * Fill in the character code of the current character */ xl_st.curchar.char_data = g_set_pointer->gset_map[cp_c7] ; /* * Fill in the rest of the fields of the current character */ xl_st.curchar.font_data = g_set_pointer->gset_fontdata ; /* Check the active position of the outgoing character */ M$CHECK_AP ( -(xl_st.curchar.font_data.above_baseline_offset+1), xl_st.curchar.font_data.below_baseline_offset ); /* If justifying, add current char to justify buffer */ if (xl_st.justify_mode) { add_to_jfy_buf (&xl_st.curchar); } /* If not justifying, AND the right margin flag is set, * do not output the character; otherwise, dispose of it. */ else { if (xl_st.rmf) { return; } process_char (&xl_st.curchar); } /* * Adjust the translator's active horizontal position to reflect * the width of the char just printed */ xl_st.curchar.ap.xval += xl_st.curchar.char_data.char_width; cp_exit_cur_mode(); }/*********************************************************************** String Terminator Dump Utility function *********************************************************************/VOID pr_st() {#ifdef DUMP { cp_exit_cur_mode(); oprintf("ST \n"); }#endif cp_exit_cur_mode(); }/**************************************************************************** Control Rendition - Print Character (Modified from Print_Text)******************************************************************************/VOID pr_char_crm(attr)WORD attr; { WORD temp1, temp2; GSET *g_set_pointer; /* * Depending on whether the incoming character code is greater than * 127 or not, select GR or GL respectively. */ g_set_pointer = (cp_c & BIT7) ? (xl_st.gr_ptr) : (xl_st.gl_ptr); if (g_set_pointer->gset_valid == FALSE) { compute_font_for_g_set ( g_set_pointer - (&xl_st.g_table[0])); } /* * Fill in the character code of the current character */ xl_st.curchar.char_data = g_set_pointer->gset_map[cp_c7] ; /* * Fill in the rest of the fields of the current character */ xl_st.curchar.font_data = g_set_pointer->gset_fontdata ; /* * Fill in the rest of the fields of the current character * (Note that if the bold flag is true, the attributes are * BOLD; otherwise they come from the font). */ xl_st.curchar.font_data.algorithmic_attributes = attr; /* Check the active position of the outgoing character */ M$CHECK_AP ( -(xl_st.curchar.font_data.above_baseline_offset+1), xl_st.curchar.font_data.below_baseline_offset ); /* If the right margin flag is set, print New Line and dispose of it; * otherwise, just dispose of it. */ if (xl_st.rmf) { pr_nel(); } process_char (&xl_st.curchar); /* * Adjust the translator's active horizontal position to reflect * the width of the char just printed */ xl_st.curchar.ap.xval += xl_st.curchar.char_data.char_width; }/**************************************************************************** Control Rendition - Print Text******************************************************************************/VOID pr_text_crm() {#ifdef DUMP { oprintf("%c", cp_c); /* print the input character */ }#endif pr_char_crm(NO_ATTR); /* print using no attributes */ }/**************************************************************************** Control Rendition - Print C0/C1 Acronym Utility Routine******************************************************************************/VOID pr_ctrl_crm(index)UBYTE index; { WORD i; /* index into acronym string */ i = 0; /* initialise the string array index */ cp_c = cp_c7 = '<'; /* get the first character */ while (cp_c7 != STRING_TERMINATOR) { pr_char_crm(BOLD); /* print the current character BOLD */ cp_c = cp_c7 = acronyms[index][i++]; /* get the next character */ } cp_c = cp_c7 = '>'; /* get the last character */ pr_char_crm(BOLD); /* print the last character BOLD */ }/**************************************************************************** Control Rendition - Print C0 Acronym******************************************************************************/VOID pr_c0_crm() { pr_ctrl_crm(cp_c7); }/**************************************************************************** Control Rendition - Print C1 Acronym******************************************************************************/VOID pr_c1_crm() { pr_ctrl_crm(cp_c7 + NUM_C0_CODES); }/**************************************************************************** Control Rendition - Print Corner Characters Acronym (SP, DEL, XA0, XFF)******************************************************************************/VOID pr_crnr_crm() { switch (cp_c) { case SP_C: pr_ctrl_crm(NUM_CTRL_CODES); break; case DEL: pr_ctrl_crm(NUM_CTRL_CODES + 1); break; case XA0: pr_ctrl_crm(NUM_CTRL_CODES + 2); break; case XFF: pr_ctrl_crm(NUM_CTRL_CODES + 3); break; default: break; } }/*********************************************************************** Escape Introducer***********************************************************************/VOID pr_esc() { cp_exit_cur_mode(); /* Exit the current state */ cp_reset(); /* Reset the param and inter buffers */ cp_setctptr(&ast_esc); /* Set State to ESC */ }/*********************************************************************** Device Control String Introducer***********************************************************************/VOID pr_dcs() { cp_exit_cur_mode(); /* Exit the current state */ cp_reset(); /* Reset the param and inter buffers */ cp_setctptr(&ast_dcs); /* Set State to DCS */ }/*********************************************************************** Control Sequence Introducer***********************************************************************/VOID pr_csi() { cp_exit_cur_mode(); /* Exit the current state */ cp_reset(); /* Reset the param and inter buffers */ cp_setctptr(&ast_csi); /* Set State to CSI */ }/*********************************************************************** Operating System Command ***********************************************************************/VOID pr_osc() { cp_exit_cur_mode(); /* Exit the current state */ cp_reset(); /* Reset the param and inter buffers */ cp_setctptr(&ast_dcsignore); /* Set State to DCS Ignore */ }/*********************************************************************** Privacy Message***********************************************************************/VOID pr_pm() { cp_exit_cur_mode(); /* Exit the current state */ cp_reset(); /* Reset the param and inter buffers */ cp_setctptr(&ast_dcsignore); /* Set State to DCS Ignore */ }/*********************************************************************** Application Program Command ***********************************************************************/VOID pr_apc() { cp_exit_cur_mode(); /* Exit the current state */ cp_reset(); /* Reset the param and inter buffers */ cp_setctptr(&ast_dcsignore); /* Set State to DCS Ignore */ }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -