Пример #1
0
void MMSDWrite(hotCtx g) {
    int i;
    MMSDCtx h = g->ctx.MMSD;

    /* Write header */
    OUT4(h->tbl.version);
    OUT2(h->tbl.flags);
    OUT2(h->tbl.axis);
    OUT2(h->tbl.instance);
    OUT2(h->tbl.style);

    /* Write axis table */
    OUT2(h->tbl.axis_.nAxes);
    OUT2(h->tbl.axis_.axisSize);
    for (i = 0; i < h->tbl.axis_.nAxes; i++) {
        AxisRec *axis = &h->tbl.axis_.axis_[i];
        OUT2(axis->longLabel);
        OUT2(axis->shortLabel);
    }

    if (h->tbl.instance != 0) {
        /* Write instance table */
        OUT2(h->tbl.instance_.nInstances);
        OUT2(h->tbl.instance_.instanceSize);
        for (i = 0; i < h->tbl.instance_.nInstances; i++) {
            OUT2(h->tbl.instance_.instance_[i].nameSuffix);
        }
    }

    if (h->tbl.style != 0) {
        /* Write style table */
        OUT2(h->tbl.style_.nStyles);
        OUT2(h->tbl.style_.styleSize);
        for (i = 0; i < h->tbl.style_.nStyles; i++) {
            StyleRec *style = &h->tbl.style_.style_[i];
            OUT1(style->axis);
            OUT1(style->flags);
            OUT4(style->action[0].point);
            OUT4(style->action[0].delta);
            OUT4(style->action[1].point);
            OUT4(style->action[1].delta);
        }
    }

    /* Write string table */
    for (i = 0; i < h->tbl.axis_.nAxes; i++) {
        AxisRec *axis = &h->tbl.axis_.axis_[i];
        hotWritePString(g, axis->longLabel_);
        hotWritePString(g, axis->shortLabel_);
    }
    if (h->tbl.instance != 0) {
        for (i = 0; i < h->tbl.instance_.nInstances; i++) {
            hotWritePString(g, h->tbl.instance_.instance_[i].nameSuffix_);
        }
    }
}
Пример #2
0
void MMFXWrite(hotCtx g)
	{
	MMFXCtx h = g->ctx.MMFX;
	int i;

	/* Write header */
	OUT4(h->tbl.version);
	OUT2(h->tbl.nMetrics);
	OUT2(h->tbl.offSize);

	/* Write offset array */
	if (h->tbl.offSize == 2)
		for (i = 0; i < h->tbl.nMetrics; i++)
			OUT2((short)h->tbl.offset[i]);
	else
		for (i = 0; i < h->tbl.nMetrics; i++)
			OUT4(h->tbl.offset[i]);

	/* Write charstring data */
	OUTN(h->cstrs.cnt, h->cstrs.array);
	}
Пример #3
0
static int output_epd_header(FILE* epd_file, gchar* name,
			     int llx, int lly, int urx, int ury)
{
  gchar* time;

  OUT_LINE ("%EPD-1.0");
  OUT1 ("%% Created by %s\n", at_version(TRUE));
  OUT1 ("%% Title: %s\n", name);
  OUT1 ("%% CreationDate: %s\n", time = at_time_string ());
  OUT4 ("%%BBox(%d,%d,%d,%d)\n", llx, lly, urx, ury);

  g_free (time);

  return 0;
}
Пример #4
0
void postWrite(hotCtx g)
	{
	postCtx h = g->ctx.post;

	OUT4(h->tbl.version);
	OUT4(h->tbl.italicAngle);
	OUT2(h->tbl.underlinePosition);
	OUT2(h->tbl.underlineThickness);
	OUT4(h->tbl.isFixedPitch);
	OUT4(h->tbl.minMemType42);
	OUT4(h->tbl.maxMemType42);
	OUT4(h->tbl.minMemType1);
	OUT4(h->tbl.maxMemType1);
	}
Пример #5
0
static void
out_splines (FILE * epd_file, spline_list_array_type shape)
{
  unsigned this_list;
  spline_list_type list;
  at_color last_color = {0,0,0};

  for (this_list = 0; this_list < SPLINE_LIST_ARRAY_LENGTH (shape);
       this_list++)
    {
      unsigned this_spline;
	  spline_type first;

      list = SPLINE_LIST_ARRAY_ELT (shape, this_list);
      first = SPLINE_LIST_ELT (list, 0);

      if (this_list == 0 || !at_color_equal(&list.color, &last_color))
        {
          if (this_list > 0)
              {
                OUT_LINE ((shape.centerline || list.open) ? "S" : "f");
                OUT_LINE("h");
              }
          OUT4 ("%.3f %.3f %.3f %s\n", (double) list.color.r / 255.0,
            (double) list.color.g / 255.0, (double) list.color.b / 255.0,
            (shape.centerline || list.open) ? "RG" : "rg");
          last_color = list.color;
        }    
      OUT_COMMAND2 (START_POINT (first).x, START_POINT (first).y, "m");

      for (this_spline = 0; this_spline < SPLINE_LIST_LENGTH (list);
           this_spline++)
        {
          spline_type s = SPLINE_LIST_ELT (list, this_spline);

          if (SPLINE_DEGREE (s) == LINEARTYPE)
            OUT_COMMAND2 (END_POINT (s).x, END_POINT (s).y, "l");
          else
            OUT_COMMAND6 (CONTROL1 (s).x, CONTROL1 (s).y,
                          CONTROL2 (s).x, CONTROL2 (s).y,
                          END_POINT (s).x, END_POINT (s).y,
                          "c");
        }
    }
  if (SPLINE_LIST_ARRAY_LENGTH(shape) > 0)
    OUT_LINE ((shape.centerline || list.open) ? "S" : "f");
}
Пример #6
0
static void writeMarkSetClassTable(hotCtx g, GDEFCtx h)
	{
	int i;
	OUT2(h->markSetClassTable.MarkSetTableFormat);
	OUT2(h->markSetClassTable.MarkSetCount);
	
	/* first write the offsets to the coverage tables */
	for (i = 0; i < h->markSetClassTable.markSetEntries.cnt; i++)
		{
		MarkSetEntry* markSetEntry = dnaINDEX(h->markSetClassTable.markSetEntries, i);
		OUT4(markSetEntry->MarkSetCoverage);
		}

	/* Now write the coverage tables */
	for (i = 0; i < h->markSetClassTable.markSetEntries.cnt; i++)
		{
		MarkSetEntry* markSetEntry = dnaINDEX(h->markSetClassTable.markSetEntries, i);
		otlCoverageWrite( g, markSetEntry->otl);
		}
	}
Пример #7
0
void hheaWrite(hotCtx g)
	{
	hheaCtx h = g->ctx.hhea;

	OUT4(h->tbl.version);
	OUT2(h->tbl.ascender);
	OUT2(h->tbl.descender);
	OUT2(h->tbl.lineGap);
	OUT2(h->tbl.advanceWidthMax);
	OUT2(h->tbl.minLeftSideBearing);
	OUT2(h->tbl.minRightSideBearing);
	OUT2(h->tbl.xMaxExtent);
	OUT2(h->tbl.caretSlopeRise);
	OUT2(h->tbl.caretSlopeRun);
	OUT2(h->tbl.caretOffset);
	OUT2(h->tbl.reserved[0]);
	OUT2(h->tbl.reserved[1]);
	OUT2(h->tbl.reserved[2]);
	OUT2(h->tbl.reserved[3]);
	OUT2(h->tbl.metricDataFormat);
	OUT2(h->tbl.numberOfLongHorMetrics);
	}
Пример #8
0
void GDEFWrite(hotCtx g)
	{
	GDEFCtx h = g->ctx.GDEF;

	/* Perform checksum adjustment */
	OUT4(h->tbl.version);
	OUT2(h->tbl.GlyphClassDefOffset);
	OUT2(h->tbl.AttachTableOffset);
	OUT2(h->tbl.LigCaretTableOffset);
	OUT2(h->tbl.MarkClassDefOffset);
	if (h->tbl.MarkGlyphSetsDefOffset) /* If this is zero, then we write a Verion 1,0 table, whcih doesn't have this offset. */
		OUT2(h->tbl.MarkGlyphSetsDefOffset);
	
	if (h->tbl.GlyphClassDefOffset)
		otlClassWrite(g, h->glyphClassTable);
	if ((h->tbl.AttachTableOffset))
		writeAttachTable(g,h);
	if ((h->tbl.LigCaretTableOffset))
		writeLigCaretTable(g,h);
	if (h->tbl.MarkClassDefOffset)
		otlClassWrite(g, h->markAttachClassTable);
	if (h->tbl.MarkGlyphSetsDefOffset)
		writeMarkSetClassTable(g, h);
	}
Пример #9
0
void maxpWrite(hotCtx g) {
    maxpCtx h = g->ctx.maxp;

    OUT4(h->tbl.version);
    OUT2(h->tbl.numGlyphs);
}