mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2025-04-22 00:16:47 +02:00
Compare commits
No commits in common. "d4e3bbcf1640926629e034a144f437ad2eb91087" and "294f5e07c5edfa2659d0b72e360ab2e74aeb0531" have entirely different histories.
d4e3bbcf16
...
294f5e07c5
72
doc/pdfio.md
72
doc/pdfio.md
@ -465,9 +465,7 @@ You create a new PDF file using the [`pdfioFileCreate`](@@) function:
|
|||||||
pdfio_rect_t media_box = { 0.0, 0.0, 612.0, 792.0 }; // US Letter
|
pdfio_rect_t media_box = { 0.0, 0.0, 612.0, 792.0 }; // US Letter
|
||||||
pdfio_rect_t crop_box = { 36.0, 36.0, 576.0, 756.0 }; // w/0.5" margins
|
pdfio_rect_t crop_box = { 36.0, 36.0, 576.0, 756.0 }; // w/0.5" margins
|
||||||
|
|
||||||
pdfio_file_t *pdf = pdfioFileCreate("myoutputfile.pdf", "2.0",
|
pdfio_file_t *pdf = pdfioFileCreate("myoutputfile.pdf", "2.0", &media_box, &crop_box, error_cb, error_data);
|
||||||
&media_box, &crop_box,
|
|
||||||
error_cb, error_data);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
where the six arguments to the function are the filename ("myoutputfile.pdf"),
|
where the six arguments to the function are the filename ("myoutputfile.pdf"),
|
||||||
@ -483,9 +481,7 @@ function:
|
|||||||
pdfio_rect_t media_box = { 0.0, 0.0, 612.0, 792.0 }; // US Letter
|
pdfio_rect_t media_box = { 0.0, 0.0, 612.0, 792.0 }; // US Letter
|
||||||
pdfio_rect_t crop_box = { 36.0, 36.0, 576.0, 756.0 }; // w/0.5" margins
|
pdfio_rect_t crop_box = { 36.0, 36.0, 576.0, 756.0 }; // w/0.5" margins
|
||||||
|
|
||||||
pdfio_file_t *pdf = pdfioFileCreateOutput(output_cb, output_ctx, "2.0",
|
pdfio_file_t *pdf = pdfioFileCreateOutput(output_cb, output_ctx, "2.0", &media_box, &crop_box, error_cb, error_data);
|
||||||
&media_box, &crop_box,
|
|
||||||
error_cb, error_data);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Once the file is created, use the [`pdfioFileCreateObj`](@@),
|
Once the file is created, use the [`pdfioFileCreateObj`](@@),
|
||||||
@ -642,16 +638,13 @@ spaces:
|
|||||||
pdfio_file_t *pdf = pdfioFileCreate(...);
|
pdfio_file_t *pdf = pdfioFileCreate(...);
|
||||||
|
|
||||||
// Create an AdobeRGB color array
|
// Create an AdobeRGB color array
|
||||||
pdfio_array_t *adobe_rgb =
|
pdfio_array_t *adobe_rgb = pdfioArrayCreateColorFromStandard(pdf, 3, PDFIO_CS_ADOBE);
|
||||||
pdfioArrayCreateColorFromStandard(pdf, 3, PDFIO_CS_ADOBE);
|
|
||||||
|
|
||||||
// Create an Display P3 color array
|
// Create an Display P3 color array
|
||||||
pdfio_array_t *display_p3 =
|
pdfio_array_t *display_p3 = pdfioArrayCreateColorFromStandard(pdf, 3, PDFIO_CS_P3_D65);
|
||||||
pdfioArrayCreateColorFromStandard(pdf, 3, PDFIO_CS_P3_D65);
|
|
||||||
|
|
||||||
// Create an sRGB color array
|
// Create an sRGB color array
|
||||||
pdfio_array_t *srgb =
|
pdfio_array_t *srgb = pdfioArrayCreateColorFromStandard(pdf, 3, PDFIO_CS_SRGB);
|
||||||
pdfioArrayCreateColorFromStandard(pdf, 3, PDFIO_CS_SRGB);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -677,7 +670,6 @@ font object for one of the base PDF fonts:
|
|||||||
- "Times-Roman"
|
- "Times-Roman"
|
||||||
- "ZapfDingbats"
|
- "ZapfDingbats"
|
||||||
|
|
||||||
Except for Symbol and ZapfDingbats (which use a custom 8-bit character set),
|
|
||||||
PDFio always uses the Windows CP1252 subset of Unicode for these fonts.
|
PDFio always uses the Windows CP1252 subset of Unicode for these fonts.
|
||||||
|
|
||||||
The second function is [`pdfioFileCreateFontObjFromFile`](@@) which creates a
|
The second function is [`pdfioFileCreateFontObjFromFile`](@@) which creates a
|
||||||
@ -685,8 +677,7 @@ font object from a TrueType/OpenType font file, for example:
|
|||||||
|
|
||||||
```c
|
```c
|
||||||
pdfio_file_t *pdf = pdfioFileCreate(...);
|
pdfio_file_t *pdf = pdfioFileCreate(...);
|
||||||
pdfio_obj_t *arial =
|
pdfio_obj_t *arial = pdfioFileCreateFontObjFromFile(pdf, "OpenSans-Regular.ttf", false);
|
||||||
pdfioFileCreateFontObjFromFile(pdf, "OpenSans-Regular.ttf", false);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
will embed an OpenSans Regular TrueType font using the Windows CP1252 subset of
|
will embed an OpenSans Regular TrueType font using the Windows CP1252 subset of
|
||||||
@ -695,16 +686,12 @@ instead, for example:
|
|||||||
|
|
||||||
```c
|
```c
|
||||||
pdfio_file_t *pdf = pdfioFileCreate(...);
|
pdfio_file_t *pdf = pdfioFileCreate(...);
|
||||||
pdfio_obj_t *arial =
|
pdfio_obj_t *arial = pdfioFileCreateFontObjFromFile(pdf, "NotoSansJP-Regular.otf", true);
|
||||||
pdfioFileCreateFontObjFromFile(pdf, "NotoSansJP-Regular.otf", true);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
will embed the NotoSansJP Regular OpenType font with full support for Unicode.
|
will embed the NotoSansJP Regular OpenType font with full support for Unicode.
|
||||||
|
|
||||||
> Note: Not all fonts support Unicode, and most do not contain a full
|
> Note: Not all fonts support Unicode.
|
||||||
> complement of Unicode characters. `pdfioFileCreateFontObjFromFile` does not
|
|
||||||
> perform any character subsetting, so the entire font file is embedded in the
|
|
||||||
> PDF file.
|
|
||||||
|
|
||||||
|
|
||||||
### Image Object Functions
|
### Image Object Functions
|
||||||
@ -718,11 +705,7 @@ in memory, for example:
|
|||||||
```c
|
```c
|
||||||
pdfio_file_t *pdf = pdfioFileCreate(...);
|
pdfio_file_t *pdf = pdfioFileCreate(...);
|
||||||
unsigned char data[1024 * 1024 * 4]; // 1024x1024 RGBA image data
|
unsigned char data[1024 * 1024 * 4]; // 1024x1024 RGBA image data
|
||||||
pdfio_obj_t *img =
|
pdfio_obj_t *img = pdfioFileCreateImageObjFromData(pdf, data, /*width*/1024, /*height*/1024, /*num_colors*/3, /*color_data*/NULL, /*alpha*/true, /*interpolate*/false);
|
||||||
pdfioFileCreateImageObjFromData(pdf, data, /*width*/1024,
|
|
||||||
/*height*/1024, /*num_colors*/3,
|
|
||||||
/*color_data*/NULL, /*alpha*/true,
|
|
||||||
/*interpolate*/false);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
will create an object for a 1024x1024 RGBA image in memory, using the default
|
will create an object for a 1024x1024 RGBA image in memory, using the default
|
||||||
@ -734,19 +717,11 @@ example:
|
|||||||
pdfio_file_t *pdf = pdfioFileCreate(...);
|
pdfio_file_t *pdf = pdfioFileCreate(...);
|
||||||
|
|
||||||
// Create an AdobeRGB color array
|
// Create an AdobeRGB color array
|
||||||
pdfio_array_t *adobe_rgb =
|
pdfio_array_t *adobe_rgb = pdfioArrayCreateColorFromMatrix(pdf, 3, pdfioAdobeRGBGamma, pdfioAdobeRGBMatrix, pdfioAdobeRGBWhitePoint);
|
||||||
pdfioArrayCreateColorFromMatrix(pdf, 3, pdfioAdobeRGBGamma,
|
|
||||||
pdfioAdobeRGBMatrix,
|
|
||||||
pdfioAdobeRGBWhitePoint);
|
|
||||||
|
|
||||||
// Create a 1024x1024 RGBA image using AdobeRGB
|
// Create a 1024x1024 RGBA image using AdobeRGB
|
||||||
unsigned char data[1024 * 1024 * 4]; // 1024x1024 RGBA image data
|
unsigned char data[1024 * 1024 * 4]; // 1024x1024 RGBA image data
|
||||||
pdfio_obj_t *img =
|
pdfio_obj_t *img = pdfioFileCreateImageObjFromData(pdf, data, /*width*/1024, /*height*/1024, /*num_colors*/3, /*color_data*/adobe_rgb, /*alpha*/true, /*interpolate*/false);
|
||||||
pdfioFileCreateImageObjFromData(pdf, data, /*width*/1024,
|
|
||||||
/*height*/1024, /*num_colors*/3,
|
|
||||||
/*color_data*/adobe_rgb,
|
|
||||||
/*alpha*/true,
|
|
||||||
/*interpolate*/false);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The "interpolate" argument specifies whether the colors in the image should be
|
The "interpolate" argument specifies whether the colors in the image should be
|
||||||
@ -758,9 +733,7 @@ function to copy the image into a PDF image object, for example:
|
|||||||
|
|
||||||
```c
|
```c
|
||||||
pdfio_file_t *pdf = pdfioFileCreate(...);
|
pdfio_file_t *pdf = pdfioFileCreate(...);
|
||||||
pdfio_obj_t *img =
|
pdfio_obj_t *img = pdfioFileCreateImageObjFromFile(pdf, "myphoto.jpg", /*interpolate*/true);
|
||||||
pdfioFileCreateImageObjFromFile(pdf, "myphoto.jpg",
|
|
||||||
/*interpolate*/true);
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -883,9 +856,7 @@ show_pdf_info(const char *filename)
|
|||||||
|
|
||||||
|
|
||||||
// Open the PDF file with the default callbacks...
|
// Open the PDF file with the default callbacks...
|
||||||
pdf = pdfioFileOpen(filename, /*password_cb*/NULL,
|
pdf = pdfioFileOpen(filename, /*password_cb*/NULL, /*password_cbdata*/NULL, /*error_cb*/NULL, /*error_cbdata*/NULL);
|
||||||
/*password_cbdata*/NULL, /*error_cb*/NULL,
|
|
||||||
/*error_cbdata*/NULL);
|
|
||||||
if (pdf == NULL)
|
if (pdf == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -921,8 +892,7 @@ the page with the text centered below:
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
create_pdf_image_file(const char *pdfname, const char *imagename,
|
create_pdf_image_file(const char *pdfname, const char *imagename, const char *caption)
|
||||||
const char *caption)
|
|
||||||
{
|
{
|
||||||
pdfio_file_t *pdf;
|
pdfio_file_t *pdf;
|
||||||
pdfio_obj_t *font;
|
pdfio_obj_t *font;
|
||||||
@ -935,9 +905,7 @@ create_pdf_image_file(const char *pdfname, const char *imagename,
|
|||||||
|
|
||||||
|
|
||||||
// Create the PDF file...
|
// Create the PDF file...
|
||||||
pdf = pdfioFileCreate(pdfname, /*version*/NULL, /*media_box*/NULL,
|
pdf = pdfioFileCreate(pdfname, /*version*/NULL, /*media_box*/NULL, /*crop_box*/NULL, /*error_cb*/NULL, /*error_cbdata*/NULL);
|
||||||
/*crop_box*/NULL, /*error_cb*/NULL,
|
|
||||||
/*error_cbdata*/NULL);
|
|
||||||
|
|
||||||
// Create a Courier base font for the caption
|
// Create a Courier base font for the caption
|
||||||
font = pdfioFileCreateFontObjFromBase(pdf, "Courier");
|
font = pdfioFileCreateFontObjFromBase(pdf, "Courier");
|
||||||
@ -957,9 +925,9 @@ create_pdf_image_file(const char *pdfname, const char *imagename,
|
|||||||
width = pdfioImageGetWidth(image);
|
width = pdfioImageGetWidth(image);
|
||||||
height = pdfioImageGetHeight(image);
|
height = pdfioImageGetHeight(image);
|
||||||
|
|
||||||
// Default media_box is "universal" 595.28x792 points (8.27x11in or
|
// Default media_box is "universal" 595.28x792 points (8.27x11in or 210x279mm)
|
||||||
// 210x279mm). Use margins of 36 points (0.5in or 12.7mm) with another
|
// Use margins of 36 points (0.5in or 12.7mm) with another 36 points for the
|
||||||
// 36 points for the caption underneath...
|
// caption underneath...
|
||||||
swidth = 595.28 - 72.0;
|
swidth = 595.28 - 72.0;
|
||||||
sheight = swidth * height / width;
|
sheight = swidth * height / width;
|
||||||
if (sheight > (792.0 - 36.0 - 72.0))
|
if (sheight > (792.0 - 36.0 - 72.0))
|
||||||
@ -976,8 +944,8 @@ create_pdf_image_file(const char *pdfname, const char *imagename,
|
|||||||
// Draw the caption in black...
|
// Draw the caption in black...
|
||||||
pdfioContentSetFillColorDeviceGray(page, 0.0);
|
pdfioContentSetFillColorDeviceGray(page, 0.0);
|
||||||
|
|
||||||
// Compute the starting point for the text - Courier is monospaced
|
// Compute the starting point for the text - Courier is monospaced with a
|
||||||
// with a nominal width of 0.6 times the text height...
|
// nominal width of 0.6 times the text height...
|
||||||
tx = 0.5 * (595.28 - 18.0 * 0.6 * strlen(caption));
|
tx = 0.5 * (595.28 - 18.0 * 0.6 * strlen(caption));
|
||||||
|
|
||||||
// Position and draw the caption underneath...
|
// Position and draw the caption underneath...
|
||||||
|
@ -231,7 +231,7 @@ static void add_links(docdata_t *dd);
|
|||||||
static pdfio_obj_t *find_image(docdata_t *dd, const char *url, size_t *imagenum);
|
static pdfio_obj_t *find_image(docdata_t *dd, const char *url, size_t *imagenum);
|
||||||
static void format_block(docdata_t *dd, mmd_t *block, docfont_t deffont, double fsize, double left, double right, const char *leader);
|
static void format_block(docdata_t *dd, mmd_t *block, docfont_t deffont, double fsize, double left, double right, const char *leader);
|
||||||
static void format_code(docdata_t *dd, mmd_t *block, double left, double right);
|
static void format_code(docdata_t *dd, mmd_t *block, double left, double right);
|
||||||
static void format_doc(docdata_t *dd, mmd_t *doc, docfont_t deffont, double left, double right);
|
static void format_doc(docdata_t *dd, mmd_t *doc, double left, double right);
|
||||||
static void format_table(docdata_t *dd, mmd_t *table, double left, double right);
|
static void format_table(docdata_t *dd, mmd_t *table, double left, double right);
|
||||||
static void make_target_name(char *dst, const char *src, size_t dstsize);
|
static void make_target_name(char *dst, const char *src, size_t dstsize);
|
||||||
static double measure_cell(docdata_t *dd, mmd_t *cell, tablecol_t *col);
|
static double measure_cell(docdata_t *dd, mmd_t *cell, tablecol_t *col);
|
||||||
@ -327,7 +327,7 @@ main(int argc, // I - Number of command-line arguments
|
|||||||
add_images(&dd, doc);
|
add_images(&dd, doc);
|
||||||
|
|
||||||
// Parse the markdown document...
|
// Parse the markdown document...
|
||||||
format_doc(&dd, doc, DOCFONT_REGULAR, dd.art_box.x1, dd.art_box.x2);
|
format_doc(&dd, doc, dd.art_box.x1, dd.art_box.x2);
|
||||||
|
|
||||||
// Close the PDF and return...
|
// Close the PDF and return...
|
||||||
if (dd.st)
|
if (dd.st)
|
||||||
@ -622,15 +622,6 @@ format_block(docdata_t *dd, // I - Document data
|
|||||||
|
|
||||||
render_line(dd, margin_left, margin_top, lineheight, num_frags, frags);
|
render_line(dd, margin_left, margin_top, lineheight, num_frags, frags);
|
||||||
|
|
||||||
if (deffont == DOCFONT_ITALIC)
|
|
||||||
{
|
|
||||||
// Add a gray bar to the left of block quotes...
|
|
||||||
set_color(dd, DOCCOLOR_GREEN);
|
|
||||||
pdfioContentPathMoveTo(dd->st, left - 6.0, dd->y - (LINE_HEIGHT - 1.0) * fsize);
|
|
||||||
pdfioContentPathLineTo(dd->st, left - 6.0, dd->y + fsize);
|
|
||||||
pdfioContentStroke(dd->st);
|
|
||||||
}
|
|
||||||
|
|
||||||
num_frags = 0;
|
num_frags = 0;
|
||||||
frag = frags;
|
frag = frags;
|
||||||
x = left;
|
x = left;
|
||||||
@ -687,15 +678,6 @@ format_block(docdata_t *dd, // I - Document data
|
|||||||
|
|
||||||
render_line(dd, margin_left, margin_top, lineheight, num_frags, frags);
|
render_line(dd, margin_left, margin_top, lineheight, num_frags, frags);
|
||||||
|
|
||||||
if (deffont == DOCFONT_ITALIC)
|
|
||||||
{
|
|
||||||
// Add a gray bar to the left of block quotes...
|
|
||||||
set_color(dd, DOCCOLOR_GREEN);
|
|
||||||
pdfioContentPathMoveTo(dd->st, left - 6.0, dd->y - (LINE_HEIGHT - 1.0) * fsize);
|
|
||||||
pdfioContentPathLineTo(dd->st, left - 6.0, dd->y + fsize);
|
|
||||||
pdfioContentStroke(dd->st);
|
|
||||||
}
|
|
||||||
|
|
||||||
num_frags = 0;
|
num_frags = 0;
|
||||||
frag = frags;
|
frag = frags;
|
||||||
x = left;
|
x = left;
|
||||||
@ -738,15 +720,6 @@ format_block(docdata_t *dd, // I - Document data
|
|||||||
margin_left = 0.0;
|
margin_left = 0.0;
|
||||||
|
|
||||||
render_line(dd, margin_left, margin_top, lineheight, num_frags, frags);
|
render_line(dd, margin_left, margin_top, lineheight, num_frags, frags);
|
||||||
|
|
||||||
if (deffont == DOCFONT_ITALIC)
|
|
||||||
{
|
|
||||||
// Add a gray bar to the left of block quotes...
|
|
||||||
set_color(dd, DOCCOLOR_GREEN);
|
|
||||||
pdfioContentPathMoveTo(dd->st, left - 6.0, dd->y - (LINE_HEIGHT - 1.0) * fsize);
|
|
||||||
pdfioContentPathLineTo(dd->st, left - 6.0, dd->y + fsize);
|
|
||||||
pdfioContentStroke(dd->st);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -786,7 +759,7 @@ format_code(docdata_t *dd, // I - Document data
|
|||||||
for (code = mmdGetFirstChild(block); code; code = mmdGetNextSibling(code))
|
for (code = mmdGetFirstChild(block); code; code = mmdGetNextSibling(code))
|
||||||
{
|
{
|
||||||
set_color(dd, DOCCOLOR_LTGRAY);
|
set_color(dd, DOCCOLOR_LTGRAY);
|
||||||
pdfioContentPathRect(dd->st, left - 3.0, dd->y - (LINE_HEIGHT - 1.0) * SIZE_CODEBLOCK, right - left + 6.0, lineheight);
|
pdfioContentPathRect(dd->st, left - 3.0, dd->y - (LINE_HEIGHT - 1.0) * SIZE_CODEBLOCK, right - left + 3.0, lineheight);
|
||||||
pdfioContentFillAndStroke(dd->st, false);
|
pdfioContentFillAndStroke(dd->st, false);
|
||||||
|
|
||||||
set_color(dd, DOCCOLOR_RED);
|
set_color(dd, DOCCOLOR_RED);
|
||||||
@ -821,7 +794,6 @@ format_code(docdata_t *dd, // I - Document data
|
|||||||
static void
|
static void
|
||||||
format_doc(docdata_t *dd, // I - Document data
|
format_doc(docdata_t *dd, // I - Document data
|
||||||
mmd_t *doc, // I - Document node to format
|
mmd_t *doc, // I - Document node to format
|
||||||
docfont_t deffont, // I - Default font
|
|
||||||
double left, // I - Left margin
|
double left, // I - Left margin
|
||||||
double right) // I - Right margin
|
double right) // I - Right margin
|
||||||
{
|
{
|
||||||
@ -851,7 +823,7 @@ format_doc(docdata_t *dd, // I - Document data
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MMD_TYPE_BLOCK_QUOTE :
|
case MMD_TYPE_BLOCK_QUOTE :
|
||||||
format_doc(dd, current, DOCFONT_ITALIC, left + 36.0, right - 36.0);
|
format_doc(dd, current, left + 36.0, right - 36.0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MMD_TYPE_ORDERED_LIST :
|
case MMD_TYPE_ORDERED_LIST :
|
||||||
@ -859,18 +831,18 @@ format_doc(docdata_t *dd, // I - Document data
|
|||||||
if (dd->st)
|
if (dd->st)
|
||||||
dd->y -= SIZE_BODY * LINE_HEIGHT;
|
dd->y -= SIZE_BODY * LINE_HEIGHT;
|
||||||
|
|
||||||
format_doc(dd, current, deffont, left + 36.0, right);
|
format_doc(dd, current, left + 36.0, right);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MMD_TYPE_LIST_ITEM :
|
case MMD_TYPE_LIST_ITEM :
|
||||||
if (doctype == MMD_TYPE_ORDERED_LIST)
|
if (doctype == MMD_TYPE_ORDERED_LIST)
|
||||||
{
|
{
|
||||||
snprintf(leader, sizeof(leader), "%d. ", i);
|
snprintf(leader, sizeof(leader), "%d. ", i);
|
||||||
format_block(dd, current, deffont, SIZE_BODY, left, right, leader);
|
format_block(dd, current, DOCFONT_REGULAR, SIZE_BODY, left, right, leader);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
format_block(dd, current, deffont, SIZE_BODY, left, right, /*leader*/"• ");
|
format_block(dd, current, DOCFONT_REGULAR, SIZE_BODY, left, right, /*leader*/"• ");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -901,7 +873,7 @@ format_doc(docdata_t *dd, // I - Document data
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MMD_TYPE_PARAGRAPH :
|
case MMD_TYPE_PARAGRAPH :
|
||||||
format_block(dd, current, deffont, SIZE_BODY, left, right, /*leader*/NULL);
|
format_block(dd, current, DOCFONT_REGULAR, SIZE_BODY, left, right, /*leader*/NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MMD_TYPE_TABLE :
|
case MMD_TYPE_TABLE :
|
||||||
@ -1442,7 +1414,7 @@ render_line(docdata_t *dd, // I - Document data
|
|||||||
else
|
else
|
||||||
pdfioContentTextShow(dd->st, UNICODE_VALUE, frag->text);
|
pdfioContentTextShow(dd->st, UNICODE_VALUE, frag->text);
|
||||||
|
|
||||||
if (frag->url && dd->num_links < DOCLINK_MAX)
|
if (frag->type == MMD_TYPE_LINKED_TEXT && frag->url && dd->num_links < DOCLINK_MAX)
|
||||||
{
|
{
|
||||||
doclink_t *l = dd->links + dd->num_links;
|
doclink_t *l = dd->links + dd->num_links;
|
||||||
// Pointer to this link record
|
// Pointer to this link record
|
||||||
|
@ -284,7 +284,7 @@ static short times_roman_widths[256] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static short zapfdingbats_widths[256] =
|
static short zapf_dingbats_widths[256] =
|
||||||
{
|
{
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
|
@ -1171,8 +1171,8 @@ pdfioContentTextMeasure(
|
|||||||
widths = times_italic_widths;
|
widths = times_italic_widths;
|
||||||
else if (!strcmp(basefont, "Times-Roman"))
|
else if (!strcmp(basefont, "Times-Roman"))
|
||||||
widths = times_roman_widths;
|
widths = times_roman_widths;
|
||||||
else if (!strcmp(basefont, "ZapfDingbats"))
|
else if (!strcmp(basefont, "Zapf-Dingbats"))
|
||||||
widths = zapfdingbats_widths;
|
widths = zapf_dingbats_widths;
|
||||||
else
|
else
|
||||||
return (0.0);
|
return (0.0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user