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

📄 xlc_dll.c

📁 <B>Digital的Unix操作系统VAX 4.2源码</B>
💻 C
📖 第 1 页 / 共 2 页
字号:
      if (!ii)        {        i = MAX_CSET_SIZE - 1;        ix = VIR_CHAR_BLOB;        }      else        {        i = ii - 1;        ix = i + 32;        }      /* If this character's bitmap pointer indicates [by being zero] that the        * glyph for this character is not defined, then the error character's        * glyph will be used for this character.       */      if ( font_bitmap[font_char_entry][i].substitute_flag == MAX_CSET_SIZE)        {        oprintf (str_blob_ref, i + graphic_set_offset );        continue;        } ;	/*	** If the sustitute flag is less than MAX_CSET_SIZE, the character is	** remapped to another character.	*/      if ( font_bitmap[font_char_entry][i].substitute_flag < MAX_CSET_SIZE)        {        oprintf (str_char_replace,		i + graphic_set_offset,		font_bitmap[font_char_entry][i].substitute_flag  );        continue;        }    	/* Calculate the first nine elements of the array which defines each 	 * character, in order, as follows:	 *	 * 1st:  Character width		 * 	   o  width table / total vertical size (from CFFF)	 * 2nd:  x component, lower left corner of character BBox	 *	   o  left bearing (from CFFF) / total vertical size (from CFFF)	 * 3rd:  y component, lower left corner of character BBox	 * 	   o  -((numrows * 24) + character baseline) / total vert. size	 * 4th:  x component, upper right corner of character BBox	 *	   o  (left bearing + (numcols * 24)) / total vert. size	 * 5th:  y component, upper right corner of character BBox	 * 	   o  -(baseline) / total vertical size	 * 6th:  width of bitmap 	 *	   o  numcols	 * 7th:  height of bitmap	 *	   o  numrows	 * 8th:  x translation component	 *	   o  -((left bearing + 12) / 24)	 * 9th:  y translation component	 *	   o  num pixel rows above baseline - .5 (NOTE: The number of	 *		pixel rows above baseline is calculated as follows:	 *		-(baseline + 12) / 24.)	 *	 * As the 2nd thru the 5th are calculated, determine if they cause   	 * any impact to the bounding box for the total font.	 */	if ( bbox_ll_x_boundary >               (ll_x_component = (float)(left_bearing_table [vax_font_table_entry]  [ix] )/ 						    real_total_vertical_size) )	    bbox_ll_x_boundary = ll_x_component;	longnumrows = font_bitmap [font_char_entry] [i] .numrows;	/* printf("\ni: %d, \n  longnumrows: %ld, \n  baseline: %ld, \nvert size: %ld,\	 *          \n  float of numerator: %.3f, \n  float of vert size: %.3f, \	 * 	 \n  numrows *24: %d, \n float(numrows): %.3f, \	 * 	 \n  float(-numrows*24): %.3f",	 * 	i, longnumrows, dll_char[i].baseline, height_table [vax_font_table_entry],	 * 	-(float)(longnumrows*24 + dll_char [i] .baseline), 	 * 	real_total_vertical_size, longnumrows*24, 	 * 	(float)longnumrows, (float)(-longnumrows*24));	 */	if ( bbox_ll_y_boundary >	     (ll_y_component = -( (float)                                   (font_bitmap [font_char_entry] [i].baseline +						 (longnumrows*24) ) /                                                      real_total_vertical_size)             )           )	    bbox_ll_y_boundary = ll_y_component;	longnumcols = font_bitmap [font_char_entry] [i] .numcols;	if ( bbox_ur_x_boundary <                 (ur_x_component = (float)(left_bearing_table [vax_font_table_entry] [ix] +				(longnumcols * 24))/real_total_vertical_size) )	    bbox_ur_x_boundary = ur_x_component;	if ( bbox_ur_y_boundary <   	   (ur_y_component = -(float)font_bitmap [font_char_entry][i].baseline /						     real_total_vertical_size) )	    bbox_ur_y_boundary = ur_y_component;	x_translation_value =		       -(float)(left_bearing_table [vax_font_table_entry] [ix] + 12) / 24.;	y_translation_value =	       -(float)(font_bitmap [font_char_entry] [i] .baseline + 12) / 24.;    	num_bytes = ((longnumcols + 7) >> 3)*longnumrows;	/* The following code compensates for a PostScript bug         */        if (!longnumcols || !longnumrows)          { /* if this is a null bitmap, the following values must as shown */          ll_x_component = 0.;	    /* x component, lower left corner of BBox */          ll_y_component = 0.;	    /* y component, lower left corner of BBox */          ur_x_component = 0.;	    /* x component, upper right corner of BBox*/          ur_y_component = 0.;	    /* y component, upper right corner of BBox*/          longnumcols = 1;	    /* width of bitmap */          longnumrows = 1;	    /* height of bitmap */          x_translation_value = 0.;          y_translation_value = 0.;          num_bytes = 0;          }        sprintf (str_buffer,"\n/a%d [%.4f %.4f %.4f %.4f %.4f %d %d %.2f %.2f\n<",    	    (i + (i==96? 32 : graphic_set_offset) ),     	    (float)(width_table [vax_font_table_entry] [ix]) / real_total_vertical_size,				    /* from width table */	    ll_x_component,	    /* x component, lower left corner 				    of BBox */	    ll_y_component,	    /* y component, lower left corner of BBox */	    ur_x_component,	    /* x component, upper right corner 				       of BBox */	    ur_y_component,	    /* y component, upper right corner 				       of BBox */    	    longnumcols,	    /* width of bitmap */    	    longnumrows,	    /* height of bitmap */	    x_translation_value,	    y_translation_value);        ps_str (str_buffer);	bytesout = 0;	bitmap_pointer = font_bitmap [font_char_entry] [i] .bitmap_ptr;	for (j=0; j<num_bytes; j++)  	  {  /*for all the bytes in the char*/	  k = *bitmap_pointer;	  k1 = k >> 4;	  k & = 0x0f;	  ps_char (inverse_nibble [k]);	  ps_char (inverse_nibble [k1]);		  bytesout++;	  if (bytesout >= (longnumcols+7) >> 3)	    {	    oprintf (str_next_line);	    bytesout = 0;	    }	  bitmap_pointer++;	  } /* end of a character */	oprintf (str_finish_bitmap);    } /* end for all characters */    /* If we are downloading into the right half of a PS font (i.e.,     * graphic_set_offset == 160) and the left half is empty, then we jam     * a valid space into char_code #32.      */    if ( left_half_is_empty && (graphic_set_offset == 160) )      {      sprintf (str_buffer,"\n/a32 [%.3f 0 0 0 0 1 1 0 0 < > ] def \n",		(float)(vax_font_table [vax_font_table_entry] .space_width) /						real_total_vertical_size );       ps_str (str_buffer);      }    oprintf (str_end);    sprintf (str_buffer,"/FontBBox [%.3f %.3f %.3f %.3f ] def\n",	bbox_ll_x_boundary,	bbox_ll_y_boundary,	bbox_ur_x_boundary,	bbox_ur_y_boundary );    ps_str (str_buffer);    oprintf (str_ul_thickness, vax_font_table [vax_font_table_entry] .ul_thickness);    oprintf (str_ul_position, vax_font_table [vax_font_table_entry] .ul_offset);    oprintf (str_ol_thickness, vax_font_table [vax_font_table_entry] .ol_thickness);    oprintf (str_ol_position, vax_font_table [vax_font_table_entry] .ol_offset);    oprintf (str_strikethru_thickness,			vax_font_table [vax_font_table_entry] .strikethru_thickness);    oprintf (str_strikethru_position,			vax_font_table [vax_font_table_entry] .strikethru_offset);    oprintf (str_end);}/*----------*/define_dll_fonts(){WORD i,j,k;    /* Redefine all downloaded fonts including the newest one */for (i = 0; i < DLL_FONT_TABLE_SIZE; i++)  {  if (dll_font_table [i] .dll_active != INACTIVE)     {    oprintf (str_define_dll_font,              i + NUMBER_OF_FIXED_FONT_BOXES,              i + NUMBER_OF_FIXED_FONT_BOXES);    oprintf (str_set_box,              i + NUMBER_OF_FIXED_FONT_BOXES,              i + NUMBER_OF_FIXED_FONT_BOXES);    }  }}/*----------*/define_spaced_fonts(){WORD i;    /* Redefine all spaced fonts including the newest one */for (i = 0; i < SPACING_FONT_TABLE_SIZE; i++)  {  if (spacing_font_table [i].space_active != INACTIVE)    {    oprintf (str_define_spaced_font, i + SPACING_OFFSET, i + SPACING_OFFSET);    oprintf (str_set_box, i + SPACING_OFFSET, i + SPACING_OFFSET);    }  }}

⌨️ 快捷键说明

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