{
    "mode": "perldoc",
    "parameter": "PDF::API2::Resource::Font::SynFont",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/PDF%3A%3AAPI2%3A%3AResource%3A%3AFont%3A%3ASynFont/json",
    "generated": "2026-06-12T15:13:06Z",
    "synopsis": "my $pdf = PDF::API2->new();\nmy $basefont = $pdf->font('Helvetica');\n# Create a condensed synthetic font\nmy $condensed = $pdf->syntheticfont($basefont, hscale => 80);\n# Compare the two fonts\nmy $text = $pdf->page->text();\n$text->font($basefont, 18);\n$text->distance(72, 720);\n$text->text('Hello World!');\n$text->font($condensed, 18);\n$text->distance(0, -36);\n$text->text('Hello World!');\n$pdf->save('sample.pdf');",
    "sections": {
        "NAME": {
            "content": "PDF::API2::Resource::Font::SynFont - Module for creating synthetic Fonts.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "my $pdf = PDF::API2->new();\nmy $basefont = $pdf->font('Helvetica');\n\n# Create a condensed synthetic font\nmy $condensed = $pdf->syntheticfont($basefont, hscale => 80);\n\n# Compare the two fonts\nmy $text = $pdf->page->text();\n\n$text->font($basefont, 18);\n$text->distance(72, 720);\n$text->text('Hello World!');\n\n$text->font($condensed, 18);\n$text->distance(0, -36);\n$text->text('Hello World!');\n\n$pdf->save('sample.pdf');\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module allows you to create a custom font based on an existing font, adjusting the scale,\nstroke thickness, angle, and other properties of each glyph.\n",
            "subsections": []
        },
        "FONT OPTIONS": {
            "content": "hscale\nA percentage to condense (less than 100) or expand (greater than 100) the glyphs horizontally.\n\nangle\nA number of degrees to lean the glyphs to the left (negative angle) or to the right (positive\nangle).\n\nbold\nA stroke width, in thousandths of a text unit, to add to the glyph's outline, creating a bold\neffect.\n\nsmallcaps\nSet to true to replace lower-case characters with small versions of their upper-case glyphs.\n\nspace\nAdditional space, in thousandths of a text unit, to add between glyphs.\n",
            "subsections": []
        }
    },
    "summary": "PDF::API2::Resource::Font::SynFont - Module for creating synthetic Fonts.",
    "flags": [],
    "examples": [],
    "see_also": []
}