📄 caspac.c
字号:
* or both. If proportional spacing is in effect, spi() is to * * have no effect. The spi parameters are assumed to either * * pixels or decipoints, depending upon the last mode set with a * * SSU command. If either paramter is omitted or is =0, use the * * default value of the currently selected font. * ************************************************************************/VOID pr_spi() {#ifdef DUMP { oprintf("SPI \n"); pprint(); /* Print the parameter list */ }#endif /* * vsi = Pv * SSU */ xl_st.vsi = cp_pbuf[0] * (LONG)xl_st.sizeunit; /* * If Ph is =0, set proportional spacing * hai = Ph * SSU */ xl_st.hai = cp_pbuf[1] * (LONG)xl_st.sizeunit; /* * Set/Clear proportional-spacing flag (PSP) * if necesarry */ invalidate_font(); }/***** shs() ********************************************************** * * * shs() - Set Horizontal Spacing. SHS is used to select the * * character spacing to be used with mono-width fonts; it has no * * effect when proportional spacing is enabled. SHS has no effect * * on character size of horizontal tab stops. * * Allowable values for Pn: * * 0 = 10 cpi - horiz pos unit = 1/10 inch * * 1 = 12 cpi - horiz pos unit = 1/12 inch * * 2 = 15 cpi - horiz pos unit = 1/15 inch * * 3 = 6 cpi - horiz pos unit = 1/6 inch * ************************************************************************/VOID pr_shs() {#ifdef DUMP { oprintf("SHS \n"); pprint(); /* Print the parameter list */ }#endif /* * Set hai */ switch (cp_pbuf[0]) { case 0: xl_st.hai = CPI_10; break; case 1: xl_st.hai = CPI_12; break; case 2: xl_st.hai = CPI_15; break; case 3: xl_st.hai = CPI_6; break; default: return; /* invalid parameter, so ignore SHS */ } /* * Set/Clear proportional-spacing flag (PSP) * if necesarry */ invalidate_font(); }/***** svs() ********************************************************** * * * svs() - Set Vertical Spacing. SHS is used to select the * * line spacing to be used with all fonts. * * Allowable values for Pn: * * 0 = 6 lpi - vert advance increment = 1/6 inch * * 1 = 4 lpi - vert advance increment = 1/4 inch * * 2 = 3 lpi - vert advance increment = 1/3 inch * * 3 = 12 lpi - vert advance increment = 1/12 inch * * 4 = 8 lpi - vert advance increment = 1/8 inch * * 5 = 6 lines/30 mm. vert adv incr = 5 mm * * 6 = 6 lines/30 mm. vert adv incr = 7.5 mm * * 7 = 3 lines/30 mm. vert adv incr = 10 mm * * 8 = 12 lines/30 mm. vert adv incr = 2.5 mm * * 9 = 2 lpi - vert advance increment = 1/2 inch * ************************************************************************/VOID pr_svs () {#ifdef DUMP { oprintf("SVS \n"); pprint(); /* Print the parameter list */ }#endif /* * Set vsi */ switch (cp_pbuf[0]) { case 0: xl_st.vsi = 1200L; break; case 1: xl_st.vsi = 1800L; break; case 2: xl_st.vsi = 2400L; break; case 3: xl_st.vsi = 600L; break; case 4: xl_st.vsi = 900L; break; /* * NOTE: the following four values are calculated from 'rounded' * pixel values, specifically to be compatible with the LN03 */ case 5: xl_st.vsi = 59L * 24L; break; case 6: xl_st.vsi = 89L * 24L; break; case 7: xl_st.vsi = 119L * 24L; break; case 8: xl_st.vsi = 30L * 24L; break; case 9: xl_st.vsi = 3600L; break; default: return; /* invalid parameter, so ignore SVS */ } /* * Set vai based on vsi */ invalidate_vai(); }/***** decverp() ****************************************************** * * * decverp() - Select vertical pitch. DECVERP determines the * * number of lines printed per inch on a page. Character size is * * not affected - only the amount of white space between lines. * * The values are computed by even divisor of 24, so 7200/24 = 300 * * is used as the multiplier for the page height (11 or 10.5) * * divided by the lines per inch desired. * Allowable values for Pn: * * 0 = Default pitch -- determined by current font * * 1 = 6 lpi * * 2 = 8 lpi * * 3 = 12 lpi * * 4 = 2 lpi * * 5 = 3 lpi * * 6 = 4 lpi * * 10 = 6.25 lpi * * 11 = 6.25 lpi * * 12 = 8.38 lpi * * 13 = 12.57 lpi * * 14 = 2.10 lpi * * 15 = 3.14 lpi * * 16 = 4.19 lpi * * * * DECVERP: does not adjust top & bottom margins * * does scale entries in vertical tab table * ************************************************************************/VOID dec_verp () { LONG old_vai;#ifdef DUMP { oprintf("DECVERP \n"); pprint(); /* Print the parameter list */ }#endif switch (cp_pbuf[0]) { case 0: xl_st.vsi = 0; /* let compute_vai determine */ break; case 1: xl_st.vsi = LPI_11_66; break; case 2: xl_st.vsi = LPI_11_88; break; case 3: xl_st.vsi = LPI_11_132; break; case 4: xl_st.vsi = LPI_11_22; break; case 5: xl_st.vsi = LPI_11_33; break; case 6: xl_st.vsi = LPI_11_44; break; case 10: xl_st.vsi = LPI_10_5_66; break; case 11: xl_st.vsi = LPI_10_5_66; break; case 12: xl_st.vsi = LPI_10_5_88; break; case 13: xl_st.vsi = LPI_10_5_132; break; case 14: xl_st.vsi = LPI_10_5_22; break; case 15: xl_st.vsi = LPI_10_5_33; break; case 16: xl_st.vsi = LPI_10_5_44; break; default: return; /* invalid parameter, so ignore VERP */ } /* * Compute the new effective vai */ old_vai = xl_st.vai; /* Save current value for tab table scaling */ compute_vai(); /* * Scale the entries in the vertical tab table */ scale_vtabs(old_vai, xl_st.vai); }/***** decshorp() ***************************************************** * * * decshorp() - Select horizontal pitch. DECSHORP determines the * * character spacing for fixed-width fonts. It takes effect only * * when DECSPM mode is reset. If a DECSHORP is received when * * DECSPM is set, the DECSHORP parameter must be saved, then when * * DECSPM is reset, the DECSHORP is effected. * * Allowable values for Pn: * * 0 = Default pitch -- determined by current font * * 1 = 10 cpi * * 2 = 12 cpi * * 3 = 13.2 cpi * * 4 = 16.5 cpi * * 5 = 5 cpi * * 6 = 6 cpi * * 7 = 6.6 cpi * * 8 = 8.25 cpi * * 9 = 15 cpi * * 10 = 12.77 cpi * * 11 = 17.1 cpi * * 12 = 8.55 cpi * * 13 = 18 cpi * * 14 = 9 cpi * * 15 = 10.3 cpi * * * * DECSHORP: does not alter the size of the characters * * does 'clear' the left and right margin * * does set line home pos equal to the left margin * * does scale entries in horizontal tab table * * does affect rmf in same way as DECSLRM * ************************************************************************/VOID dec_shorp () { LONG old_hai, new_hai;#ifdef DUMP { oprintf("DECSHORP \n"); pprint(); /* Print the parameter list */ }#endif /* * Store the DECSHORP value just received (if it is valid) */ if (cp_pbuf[0] > 15) { return; /* Return if unsupported param */ } xl_st.shorp = (WORD)cp_pbuf[0]; /* * Combine the values of DECPSM and DECSHORP to define xl_st.hai. */ compute_spacing (&old_hai, &new_hai); /* * Set the margins by imitating a DECSRLM */ cp_pbuf[0] = 1; cp_pbuf[1] = 32767; dec_slrm(); /* Scale the horizontal tabs table. (refer to the PSRM Chapter 9 [on tabs] * sec 6.2.2 "No other commands [besides DECSHORP and DECVORP] scale the * tabs stop position.") */ scale_htabs (old_hai, new_hai);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -