⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cacfff.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
📖 第 1 页 / 共 4 页
字号:
/* Read "struckthru_font_flag" from font_attr_flags.  If this is * NOT a struckthru font, then get the strikethru offset and thickness * from the font parameters in case strikethru is requested (in * which case algorithmic strikethru will have to be performed). */dll_font.dll_strikethru_flag = font_attr_flags & STRUCKTHRU_FONT_FLAG;#ifdef WITHOUTPUT	fprintf (fptr, "\ndll_strikethru_flag= %xH", dll_font.dll_strikethru_flag);#endifif (dll_font.dll_strikethru_flag == 0)  {  dll_font.dll_strikethru_offset = GET_LONG(bufptr + OFFSET_STRIKETHRU_OFFSET);  dll_font.dll_strikethru_thickness = GET_LONG(bufptr + OFFSET_STRIKETHRU_THICKNESS);  }#ifdef WITHOUTPUT  	fprintf (fptr, "\nstrikethru_offset= %xH", dll_font.dll_strikethru_offset);	fprintf (fptr, "\nstrikethru_thickness= %xH", dll_font.dll_strikethru_thickness);#endif/* * Read "overlined_font_flag" from font_attr_flags.  If this is * NOT an overlined font, then get the overline offset and thickness * from the font parameters in case overlining is requested (in * which case algorithmic overlining will have to be performed). * */dll_font.dll_ol_font_flag = font_attr_flags & OVERLINED_FONT_FLAG;#ifdef WITHOUTPUT	fprintf (fptr, "\nol_font_flag= %xH", 	dll_font.dll_ol_font_flag);#endifif (dll_font.dll_ol_font_flag == 0)  {  dll_font.dll_ol_offset = GET_LONG(bufptr + OFFSET_OVERLINE_OFFSET);  dll_font.dll_ol_thickness = GET_LONG(bufptr + OFFSET_OVERLINE_THICKNESS);  }#ifdef WITHOUTPUT  	fprintf (fptr, "\nol_offset= %xH", dll_font.dll_ol_offset);	fprintf (fptr, "\nol_thickness= %xH", dll_font.dll_ol_thickness);#endif/* Read "shadow_flag" from font attributes */dll_font.dll_shadow_flag = font_attr_flags & SHADOW_FLAG;dll_font.dll_shadow_vertical = *((FONT_METRIC *)(bufptr + 					OFFSET_SHADOW_VERTICAL_OFFSET));dll_font.dll_shadow_horizontal = *((FONT_METRIC *)(bufptr +					OFFSET_SHADOW_HORIZONTAL_OFFSET));#ifdef WITHOUTPUT  fprintf (fptr,  "dll_font.dll_shadow_flag %ld, dll_font.dll_shadow_vertical %d,dll_font.dll_shadow_horizontal %d\n", dll_font.dll_shadow_flag, 		dll_font.dll_shadow_vertical, dll_font.dll_shadow_horizontal);#endif/* Read "italic_flag" from font attributes */dll_font.dll_italic_flag = font_attr_flags & ITALIC_FLAG;#ifdef WITHOUTPUT	fprintf (fptr, "\ndll_italic_flag= %xH", dll_font.dll_italic_flag);#endif/* Get the font weight (i.e., bolding) from the font attributes; * if its value is not BOLD or greater, clear the bold flag.   */dll_font.dll_font_weight = GET_LONG(bufptr + OFFSET_FONT_WEIGHT);#ifdef WITHOUTPUT	fprintf (fptr, "\ndll_font_weight= %xH", dll_font.dll_font_weight);#endif/* Check if this is a monospaced or proportional font */dll_font.dll_monospacing_flag = font_attr_flags & MONOSPACING_FLAG;#ifdef WITHOUTPUT	fprintf (fptr, "\ndll_monospacing_flag= %xH", dll_font.dll_monospacing_flag);#endif/* Get the type size of the font. *//*** IMPORTANT NOTE:  A DECISION NEEDS TO BE MADE HERE AS TO WHICH OF *   THE TWO "TYPE SIZES" SUPPLIED BELOW IS THE CORRECT ONE FOR OUR *   NEEDS.  TO DECIDE, SEE SECTION 3.4.8 (P.3-30) IN THE CFFF MANUAL *   FOR DESCRIPTION OF "TYPE SIZE" AND SECTION 3.5.5.4 (P.3-55) FOR *   DESCRIPTION OF "TOTAL VERTICAL SIZE".  WE MAY ULTIMATELY NEED BOTH, *   ONE FOR SELECTING THE FONT, THE OTHER FOR PRINTING THE FONT. * *    7-OCT-1986 12:29:54 'dll_type_size' is used in the font selection  *   process by 'compute_font_for_g_set'. 'dll_total_vertical_size' is used to  *   normalize the scale of character metrics in 'dll'. ***//* (This section fetches "Type Size" from the CFFF.)  The low word  * of this longword contains the point size in whole numbers.  The  * high word indicates additional ten-thousandths of a point.   * * The WORD returned in dll_type_size is calculated as follows: * low word (# of whole pts) multiplied by 100 (to convert * to centipoints), PLUS the high word (which represents # of  * 10,000th's points) divided by 100 (to convert to centipts).   *//* Check that the font is less than three inches (MAX_FONT_SIZE = 216 point); * this also ensures that an overflow does not occur, since type size is only * stored in an unsigned word.  */if ( *((WORD *)(bufptr + OFFSET_TYPE_SIZE)) >= MAX_FONT_SIZE )  {#ifdef WITHOUTPUT  printf ("font size %d", *((WORD *)(bufptr + OFFSET_TYPE_SIZE)));#endif  ABORT_MACRO(73);	/* Font size is greater than 3 inches */  return (TRUE);  }dll_font.dll_type_size_whole = *((UWORD *)(bufptr + OFFSET_TYPE_SIZE));dll_font.dll_type_size_fraction = *((UWORD *)(bufptr + OFFSET_TYPE_SIZE+2));dll_font.dll_type_size = (*((WORD *)(bufptr + OFFSET_TYPE_SIZE)) * 100);dll_font.dll_type_size += (*((WORD *)(bufptr + OFFSET_TYPE_SIZE+2)) / 100);#ifdef WITHOUTPUT	fprintf (fptr, "\ndll_type_size= %xH", dll_font.dll_type_size);#endif/* (This section fetches "Total Vertical Size" from the CFFF.) * This parameter is in units of centipoints; it gives the total * vertical size of the type field, which I believe is the one * we want for printing.  SEE SECTION 3.5.5.4 (P.3-55) OF THE CFFF MANUAL  * FOR DESCRIPTION. */dll_font.dll_total_vertical_size = GET_LONG(bufptr + OFFSET_TOTAL_VERTICAL_SIZE);#ifdef WITHOUTPUT     fprintf (fptr, "\ndll_total_vertical_size= %xH", dll_font.dll_total_vertical_size);#endifif ( dll_font.dll_total_vertical_size >= MAX_FONT_SIZE * 100 )  {  ABORT_MACRO(74); /* Font total vertical size is greater than 3 inches */  return (TRUE);  }/* Get average character width for font (in centipoints). * * THIS WILL BE OVER-WRITTEN; SEE 'dll_space_width' BELOW. */dll_font.dll_average_char_width = GET_LONG(bufptr + OFFSET_AVERAGE_CHAR_WIDTH);#ifdef WITHOUTPUT      fprintf (fptr, "\ndll_average_char_width= %lxH", dll_font.dll_average_char_width);#endif/* Get the horizontal proportion of the font. (See cfff_offsets.h for * possible values of this variable.  It is comprised of two longwords, * one containing a whole number and one a fractional value.) */dll_font.dll_font_horiz_prop = GET_LONG(bufptr + OFFSET_FONT_HORIZ_PROPORTION);#ifdef WITHOUTPUT	fprintf (fptr, "\ndll_font_horiz_prop = %xH", dll_font.dll_font_horiz_prop);#endifdll_font.dll_horiz_prop_numerator = *((WORD *)(bufptr + OFFSET_FONT_HORIZ_PROP_FRAC));dll_font.dll_horiz_prop_denominator = *((WORD *)(bufptr +OFFSET_FONT_HORIZ_PROP_FRAC+2));#ifdef WITHOUTPUT	fprintf (fptr, "\ndll_horiz_prop_numerator = %xH",						dll_font.dll_horiz_prop_numerator);	fprintf (fptr, "\ndll_horiz_prop_denominator = %xH",						dll_font.dll_horiz_prop_denominator);#endif/* Get the vertical distance for superscripts and subscripts (in  * centipoints). */dll_font.dll_superscript_vert = GET_LONG(bufptr + OFFSET_SUPERSCRIPT_VERTICAL);#ifdef WITHOUTPUT	fprintf (fptr, "\ndll_superscript_vert = %lxH", dll_font.dll_superscript_vert);#endifdll_font.dll_subscript_vert = GET_LONG(bufptr + OFFSET_SUBSCRIPT_VERTICAL);#ifdef WITHOUTPUT	fprintf (fptr, "\ndll_subscript_vert = %xH", dll_font.dll_subscript_vert);#endifdll_font.dll_subscript_vert = GET_LONG(bufptr + OFFSET_SUBSCRIPT_VERTICAL);#ifdef WITHOUTPUT	fprintf (fptr, "\ndll_subscript_vert = %xH", dll_font.dll_subscript_vert);#endif/* Get max and min space sizes for font.  NOTE that these are actual * interword space lengths in centipoints, NOT percentages!  */dll_font.dll_space_max = GET_LONG(bufptr + OFFSET_MAX_SPACE_WIDTH);#ifdef WITHOUTPUT	fprintf (fptr, "\ndll_space_max = %xH", dll_font.dll_space_max);#endifdll_font.dll_space_min = GET_LONG(bufptr + OFFSET_MIN_SPACE_WIDTH);#ifdef WITHOUTPUT	fprintf (fptr, "\ndll_space_min = %xH", dll_font.dll_space_min);#endif/* Get width of the space character in this font (in centipts). */dll_font.dll_space_width = GET_LONG(bufptr + OFFSET_WIDTH_OF_SPACE);#ifdef WITHOUTPUT	fprintf (fptr, "\ndll_space_width = %xH", dll_font.dll_space_width);#endifif ( dll_font.dll_spacing && (dll_font.dll_average_char_width != dll_font.dll_space_width) )  {  WARNING_MACRO(71);	/* Inconsistent font widths */  }/* Due to an inconsistancy in the PSRM on whether to use space_width or  * average_width for mono_spacing of proportionally spaced font, the LN03 uses * space_width while this translator uses average_width. To restore * compatibility we over-write average_width as follows:  */dll_font.dll_average_char_width = dll_font.dll_space_width;/* Determine baseline placement by finding the distances above baseline * and below baseline.  (NOTE THAT DISTANCE ABOVE BASELINE IS GOING * TO BE A *NEGATIVE* VALUE.) * (QUESTION:  What are these values used for?  Each character  *             definition contains an explicit "baseline" field.) */dll_font.dll_above_baseline_dist = GET_LONG(bufptr + OFFSET_ABOVE_BASELINE_OFFSET);   dll_font.dll_below_baseline_dist = GET_LONG(bufptr + OFFSET_BELOW_BASELINE_OFFSET);/* Get encoded scale factor for font (indicates magnification of the * font independent of its specified character size). * * The scale factor will be a 1-byte base 36 value, encoded as  * follows: *                   code       value         comments * *                   0        .25             16-up *                   1        .254765  *                   2        .279081  *                   3        .305718  *                   4        .333333         9-up *                   5        .334898  *                   6        .366862  *                   7        .401877  *                   8        .440235  *                   9        .482253 *                   A        .5              4-up *                   B        .528282  *                   C        .577350         3-up *                   D        .578704  *                   E        .633938  *                   F        .694444  *                   G        .707107         2-up *                   H        .760726  *                   I        .833333  *                   J        .912871  *                   K       1                Normal *                   L       1.09545          TeX's \magstephalf *                   M       1.2              TeX's \magstep1 *                   N       1.31453   *                   O       1.44             TeX's \magstep2 *                   P       1.57744  *                   Q       1.728            TeX's \magstep3 *                   R       1.89293  *                   S       2.0              TeX's "at 20pt" *                   T       2.0736           TeX's \magstep4 *                   U       2.27152  *                   V       2.48832          TeX's \magstep5 *                   W       2.72582  *                   X       2.98598  *                   Y       3.0              TeX's "at 30pt" *                   Z       3.27098  * * These are mostly factors of sqrt(1.2), with  0.25,  0.333333,  0.5, * 0.5735, 0.707107, 2.0 and 3.0 added. * * NOTE that it is up to the caller of analyze_font_file () to decode * dll_scale_factor. */dll_font.dll_scale_factor_code = dll_font.new_font_file_id [12];/* Get number of character definitions included in this font file */dll_font.dll_num_char_defs = GET_LONG(bufptr + OFFSET_NUM_CHAR_DEFS);#ifdef WITHOUTPUT	fprintf	(fptr, "\nNumber of char definitions in this file: %d.",				    			dll_font.dll_num_char_defs);#endif/* Set up first and last character index. */start_idx = dll_font.dll_first_char - 32;end_idx = dll_font.dll_last_char - 32;if ( dll_font.dll_num_char_defs != end_idx - start_idx + 1 )  {  WARNING_MACRO (75); /* Character number does not agree with last-first range*/#ifdef WITHOUTPUT  fprintf (fptr,           "\nNumber of char definitions in this file (%d) does not match number of first char (%d) and number of lsst char (%d)",	    dll_font.dll_num_char_defs, start_idx, end_idx);#endif  }/* Now cycle through each character defined, check that its type=81H,  * and if so, "pick out" its width, left bearing, baseline, and raster. */if (start_idx)  {  /* here need to put "blobs" in slots[0-(start_idx-1)] of the   * dll_char table, and the corresponding "blob" info in the   * same slots in the width, l_bearing, and r_bearing tables.   */  for (i=0; i<start_idx; i++)    substitute_blob_for_char (&dll_font.dll_char [i], i);	    #ifdef WITHOUTPUT   fprintf (fptr, "\n\nDll_char [0] through [%d] were replaced by blob.\n",i-1);#endif  }/* Actual character loop, the stuff above was just initialization */for (i=start_idx;i <= end_idx; i++)   {	/*Start For All characters loop*/#ifdef WITHOUTPUT	fprintf (fptr, "\n\n i= %d", i);#endif  /* Create an index into the character directory to pick up   * each succeeding character's locator.   */  char_dir_idx = (i - start_idx) * LONGWORD;#ifdef WITHOUTPUT  	fprintf (fptr, "\nchar_dir_idx = %xH", char_dir_idx);#endif    	  if ( ( temploc = GET_LONG((bufptr + OFFSET_CHAR_DIR_REGION) + char_dir_idx)) > buflen )    {    ABORT_MACRO(64);	/* Character locator pts out of range */    return (TRUE);    }  else     current_locator = temploc;#ifdef WITHOUTPUT      fprintf (fptr, "\nACTUAL Current locator [%d] = %xH", i, current_locator);#endif  /* If a character's locator is 0, then use a reference to the blob.   *   * The CFFF, in 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -