class EmbeddedVerticalFonts
{
    private EmbeddedVerticalFonts()
    {
    }

    public static void main(String[] args) throws IOException
    {<FILL_FUNCTION_BODY>}
}

        PDDocument document = new PDDocument();
        PDPage page = new PDPage();
        document.addPage(page);

        // The actual font file
        // Download: https://moji.or.jp/wp-content/ipafont/IPAfont/ipag00303.zip
        // (free license: https://www.gnu.org/licenses/license-list.html#IPAFONT)
        File ipafont = new File("ipag.ttf");

        // You can also use a Windows 7 TrueType font collection, e.g. MingLiU:
        // TrueTypeFont ttf = new TrueTypeCollection(new File("C:/windows/fonts/mingliu.ttc")).getFontByName("MingLiU")
        // PDType0Font.loadVertical(document, ttf, true)

        // Load as horizontal
        PDType0Font hfont = PDType0Font.load(document, ipafont);

        // Load as vertical
        PDType0Font vfont = PDType0Font.loadVertical(document, ipafont);

        // Load as vertical, but disable vertical glyph substitution
        // (You will usually not want this because it doesn't look good!)
        TrueTypeFont ttf = new TTFParser().parse(new RandomAccessReadBufferedFile(ipafont));
        PDType0Font vfont2 = PDType0Font.loadVertical(document, ttf, true);
        ttf.disableGsubFeature("vrt2");
        ttf.disableGsubFeature("vert");

        try (PDPageContentStream contentStream = new PDPageContentStream(document, page))
        {
            contentStream.beginText();
            contentStream.setFont(hfont, 20);
            contentStream.setLeading(25);
            contentStream.newLineAtOffset(20, 300);
            contentStream.showText("Key:");
            contentStream.newLine();
            contentStream.showText("① Horizontal");
            contentStream.newLine();
            contentStream.showText("② Vertical with substitution");
            contentStream.newLine();
            contentStream.showText("③ Vertical without substitution");
            contentStream.endText();

            contentStream.beginText();
            contentStream.setFont(hfont, 20);
            contentStream.newLineAtOffset(20, 650);
            contentStream.showText("①「あーだこーだ」");
            contentStream.endText();

            contentStream.beginText();
            contentStream.setFont(vfont, 20);
            contentStream.newLineAtOffset(50, 600);
            contentStream.showText("②「あーだこーだ」");
            contentStream.endText();

            contentStream.beginText();
            contentStream.setFont(vfont2, 20);
            contentStream.newLineAtOffset(100, 600);
            contentStream.showText("③「あーだこーだ」");
            contentStream.endText();
        }
        // result file should look like the one attached to JIRA issue PDFBOX-4106
        document.save("vertical.pdf");
    
<no_super_class>