[{"data":1,"prerenderedAt":1449},["ShallowReactive",2],{"blog-en-ipaex-gothic-gpdf":3},{"id":4,"title":5,"author":6,"body":9,"date":1413,"description":1414,"draft":1415,"extension":1416,"howTo":1417,"image":1439,"meta":1440,"navigation":86,"path":1441,"seo":1442,"stem":1443,"tags":1444,"updated":1439,"__hash__":1448},"blog/blog/009.ipaex-gothic-gpdf.md","How do I use IPAex Gothic in gpdf?",{"name":7,"url":8},"gpdf team","https://gpdf.dev",{"type":10,"value":11,"toc":1402},"minimark",[12,17,35,39,55,59,728,750,754,757,820,823,829,833,836,839,848,880,886,1177,1180,1184,1193,1221,1228,1231,1235,1320,1323,1327,1362,1366,1369,1386,1398],[13,14,16],"h2",{"id":15},"the-question-in-other-words","The question, in other words",[18,19,20,21,28,29,34],"p",{},"You want to use IPAex Gothic — the proportional Gothic font the Japanese ",[22,23,27],"a",{"href":24,"rel":25},"https://moji.or.jp/ipafont/",[26],"nofollow","Information-technology Promotion Agency"," (IPA) maintains — in a ",[22,30,33],{"href":31,"rel":32},"https://github.com/gpdf-dev/gpdf",[26],"gpdf"," document. The typical reasons: e-Tax PDF submissions, government-facing paperwork, or just a house style that's been on IPAex since the early 2010s. Three things trip people up: which file to grab, how to deal with there being no Bold, and what the IPA Font License actually asks of you.",[13,36,38],{"id":37},"tldr","TL;DR",[18,40,41,42,46,47,50,51,54],{},"Register ",[43,44,45],"code",{},"ipaexg.ttf"," with ",[43,48,49],{},"gpdf.WithFont(\"IPAexGothic\", bytes)",". Set it as the default. Bold emphasis has to be synthesized with ",[43,52,53],{},"template.Bold()"," or paired with IPAex Mincho since IPAex ships only Regular. Keep the license text next to the binary.",[13,56,58],{"id":57},"the-complete-example","The complete example",[60,61,66],"pre",{"className":62,"code":63,"language":64,"meta":65,"style":65},"language-go shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","package main\n\nimport (\n    \"log\"\n    \"os\"\n\n    \"github.com/gpdf-dev/gpdf\"\n    \"github.com/gpdf-dev/gpdf/document\"\n    \"github.com/gpdf-dev/gpdf/template\"\n)\n\nfunc main() {\n    font, err := os.ReadFile(\"ipaexg.ttf\")\n    if err != nil {\n        log.Fatal(err)\n    }\n\n    doc := gpdf.NewDocument(\n        gpdf.WithPageSize(gpdf.A4),\n        gpdf.WithMargins(document.UniformEdges(document.Mm(25))),\n        gpdf.WithFont(\"IPAexGothic\", font),\n        gpdf.WithDefaultFont(\"IPAexGothic\", 10.5),\n    )\n\n    page := doc.AddPage()\n    page.AutoRow(func(r *template.RowBuilder) {\n        r.Col(12, func(c *template.ColBuilder) {\n            c.Text(\"請求書\", template.FontSize(24), template.Bold())\n            c.Text(\"令和8年4月17日発行\")\n            c.Text(\"金額: ¥100,000 (税込)\")\n        })\n    })\n\n    data, err := doc.Generate()\n    if err != nil {\n        log.Fatal(err)\n    }\n    if err := os.WriteFile(\"invoice.pdf\", data, 0o644); err != nil {\n        log.Fatal(err)\n    }\n}\n","go","",[43,67,68,81,88,98,110,120,125,135,145,155,161,166,182,220,236,254,260,265,284,307,345,371,396,402,407,426,460,497,545,565,585,591,597,602,623,636,651,656,702,717,722],{"__ignoreMap":65},[69,70,73,77],"span",{"class":71,"line":72},"line",1,[69,74,76],{"class":75},"sMK4o","package",[69,78,80],{"class":79},"sBMFI"," main\n",[69,82,84],{"class":71,"line":83},2,[69,85,87],{"emptyLinePlaceholder":86},true,"\n",[69,89,91,95],{"class":71,"line":90},3,[69,92,94],{"class":93},"s7zQu","import",[69,96,97],{"class":75}," (\n",[69,99,101,104,107],{"class":71,"line":100},4,[69,102,103],{"class":75},"    \"",[69,105,106],{"class":79},"log",[69,108,109],{"class":75},"\"\n",[69,111,113,115,118],{"class":71,"line":112},5,[69,114,103],{"class":75},[69,116,117],{"class":79},"os",[69,119,109],{"class":75},[69,121,123],{"class":71,"line":122},6,[69,124,87],{"emptyLinePlaceholder":86},[69,126,128,130,133],{"class":71,"line":127},7,[69,129,103],{"class":75},[69,131,132],{"class":79},"github.com/gpdf-dev/gpdf",[69,134,109],{"class":75},[69,136,138,140,143],{"class":71,"line":137},8,[69,139,103],{"class":75},[69,141,142],{"class":79},"github.com/gpdf-dev/gpdf/document",[69,144,109],{"class":75},[69,146,148,150,153],{"class":71,"line":147},9,[69,149,103],{"class":75},[69,151,152],{"class":79},"github.com/gpdf-dev/gpdf/template",[69,154,109],{"class":75},[69,156,158],{"class":71,"line":157},10,[69,159,160],{"class":75},")\n",[69,162,164],{"class":71,"line":163},11,[69,165,87],{"emptyLinePlaceholder":86},[69,167,169,172,176,179],{"class":71,"line":168},12,[69,170,171],{"class":75},"func",[69,173,175],{"class":174},"s2Zo4"," main",[69,177,178],{"class":75},"()",[69,180,181],{"class":75}," {\n",[69,183,185,189,192,195,198,201,204,207,210,213,216,218],{"class":71,"line":184},13,[69,186,188],{"class":187},"sTEyZ","    font",[69,190,191],{"class":75},",",[69,193,194],{"class":187}," err ",[69,196,197],{"class":75},":=",[69,199,200],{"class":187}," os",[69,202,203],{"class":75},".",[69,205,206],{"class":174},"ReadFile",[69,208,209],{"class":75},"(",[69,211,212],{"class":75},"\"",[69,214,45],{"class":215},"sfazB",[69,217,212],{"class":75},[69,219,160],{"class":75},[69,221,223,226,228,231,234],{"class":71,"line":222},14,[69,224,225],{"class":93},"    if",[69,227,194],{"class":187},[69,229,230],{"class":75},"!=",[69,232,233],{"class":75}," nil",[69,235,181],{"class":75},[69,237,239,242,244,247,249,252],{"class":71,"line":238},15,[69,240,241],{"class":187},"        log",[69,243,203],{"class":75},[69,245,246],{"class":174},"Fatal",[69,248,209],{"class":75},[69,250,251],{"class":187},"err",[69,253,160],{"class":75},[69,255,257],{"class":71,"line":256},16,[69,258,259],{"class":75},"    }\n",[69,261,263],{"class":71,"line":262},17,[69,264,87],{"emptyLinePlaceholder":86},[69,266,268,271,273,276,278,281],{"class":71,"line":267},18,[69,269,270],{"class":187},"    doc ",[69,272,197],{"class":75},[69,274,275],{"class":187}," gpdf",[69,277,203],{"class":75},[69,279,280],{"class":174},"NewDocument",[69,282,283],{"class":75},"(\n",[69,285,287,290,292,295,297,299,301,304],{"class":71,"line":286},19,[69,288,289],{"class":187},"        gpdf",[69,291,203],{"class":75},[69,293,294],{"class":174},"WithPageSize",[69,296,209],{"class":75},[69,298,33],{"class":187},[69,300,203],{"class":75},[69,302,303],{"class":187},"A4",[69,305,306],{"class":75},"),\n",[69,308,310,312,314,317,319,322,324,327,329,331,333,336,338,342],{"class":71,"line":309},20,[69,311,289],{"class":187},[69,313,203],{"class":75},[69,315,316],{"class":174},"WithMargins",[69,318,209],{"class":75},[69,320,321],{"class":187},"document",[69,323,203],{"class":75},[69,325,326],{"class":174},"UniformEdges",[69,328,209],{"class":75},[69,330,321],{"class":187},[69,332,203],{"class":75},[69,334,335],{"class":174},"Mm",[69,337,209],{"class":75},[69,339,341],{"class":340},"sbssI","25",[69,343,344],{"class":75},"))),\n",[69,346,348,350,352,355,357,359,362,364,366,369],{"class":71,"line":347},21,[69,349,289],{"class":187},[69,351,203],{"class":75},[69,353,354],{"class":174},"WithFont",[69,356,209],{"class":75},[69,358,212],{"class":75},[69,360,361],{"class":215},"IPAexGothic",[69,363,212],{"class":75},[69,365,191],{"class":75},[69,367,368],{"class":187}," font",[69,370,306],{"class":75},[69,372,374,376,378,381,383,385,387,389,391,394],{"class":71,"line":373},22,[69,375,289],{"class":187},[69,377,203],{"class":75},[69,379,380],{"class":174},"WithDefaultFont",[69,382,209],{"class":75},[69,384,212],{"class":75},[69,386,361],{"class":215},[69,388,212],{"class":75},[69,390,191],{"class":75},[69,392,393],{"class":340}," 10.5",[69,395,306],{"class":75},[69,397,399],{"class":71,"line":398},23,[69,400,401],{"class":75},"    )\n",[69,403,405],{"class":71,"line":404},24,[69,406,87],{"emptyLinePlaceholder":86},[69,408,410,413,415,418,420,423],{"class":71,"line":409},25,[69,411,412],{"class":187},"    page ",[69,414,197],{"class":75},[69,416,417],{"class":187}," doc",[69,419,203],{"class":75},[69,421,422],{"class":174},"AddPage",[69,424,425],{"class":75},"()\n",[69,427,429,432,434,437,440,444,447,450,452,455,458],{"class":71,"line":428},26,[69,430,431],{"class":187},"    page",[69,433,203],{"class":75},[69,435,436],{"class":174},"AutoRow",[69,438,439],{"class":75},"(func(",[69,441,443],{"class":442},"sHdIc","r",[69,445,446],{"class":75}," *",[69,448,449],{"class":79},"template",[69,451,203],{"class":75},[69,453,454],{"class":79},"RowBuilder",[69,456,457],{"class":75},")",[69,459,181],{"class":75},[69,461,463,466,468,471,473,476,478,481,484,486,488,490,493,495],{"class":71,"line":462},27,[69,464,465],{"class":187},"        r",[69,467,203],{"class":75},[69,469,470],{"class":174},"Col",[69,472,209],{"class":75},[69,474,475],{"class":340},"12",[69,477,191],{"class":75},[69,479,480],{"class":75}," func(",[69,482,483],{"class":442},"c",[69,485,446],{"class":75},[69,487,449],{"class":79},[69,489,203],{"class":75},[69,491,492],{"class":79},"ColBuilder",[69,494,457],{"class":75},[69,496,181],{"class":75},[69,498,500,503,505,508,510,512,515,517,519,522,524,527,529,532,535,537,539,542],{"class":71,"line":499},28,[69,501,502],{"class":187},"            c",[69,504,203],{"class":75},[69,506,507],{"class":174},"Text",[69,509,209],{"class":75},[69,511,212],{"class":75},[69,513,514],{"class":215},"請求書",[69,516,212],{"class":75},[69,518,191],{"class":75},[69,520,521],{"class":187}," template",[69,523,203],{"class":75},[69,525,526],{"class":174},"FontSize",[69,528,209],{"class":75},[69,530,531],{"class":340},"24",[69,533,534],{"class":75},"),",[69,536,521],{"class":187},[69,538,203],{"class":75},[69,540,541],{"class":174},"Bold",[69,543,544],{"class":75},"())\n",[69,546,548,550,552,554,556,558,561,563],{"class":71,"line":547},29,[69,549,502],{"class":187},[69,551,203],{"class":75},[69,553,507],{"class":174},[69,555,209],{"class":75},[69,557,212],{"class":75},[69,559,560],{"class":215},"令和8年4月17日発行",[69,562,212],{"class":75},[69,564,160],{"class":75},[69,566,568,570,572,574,576,578,581,583],{"class":71,"line":567},30,[69,569,502],{"class":187},[69,571,203],{"class":75},[69,573,507],{"class":174},[69,575,209],{"class":75},[69,577,212],{"class":75},[69,579,580],{"class":215},"金額: ¥100,000 (税込)",[69,582,212],{"class":75},[69,584,160],{"class":75},[69,586,588],{"class":71,"line":587},31,[69,589,590],{"class":75},"        })\n",[69,592,594],{"class":71,"line":593},32,[69,595,596],{"class":75},"    })\n",[69,598,600],{"class":71,"line":599},33,[69,601,87],{"emptyLinePlaceholder":86},[69,603,605,608,610,612,614,616,618,621],{"class":71,"line":604},34,[69,606,607],{"class":187},"    data",[69,609,191],{"class":75},[69,611,194],{"class":187},[69,613,197],{"class":75},[69,615,417],{"class":187},[69,617,203],{"class":75},[69,619,620],{"class":174},"Generate",[69,622,425],{"class":75},[69,624,626,628,630,632,634],{"class":71,"line":625},35,[69,627,225],{"class":93},[69,629,194],{"class":187},[69,631,230],{"class":75},[69,633,233],{"class":75},[69,635,181],{"class":75},[69,637,639,641,643,645,647,649],{"class":71,"line":638},36,[69,640,241],{"class":187},[69,642,203],{"class":75},[69,644,246],{"class":174},[69,646,209],{"class":75},[69,648,251],{"class":187},[69,650,160],{"class":75},[69,652,654],{"class":71,"line":653},37,[69,655,259],{"class":75},[69,657,659,661,663,665,667,669,672,674,676,679,681,683,686,688,691,694,696,698,700],{"class":71,"line":658},38,[69,660,225],{"class":93},[69,662,194],{"class":187},[69,664,197],{"class":75},[69,666,200],{"class":187},[69,668,203],{"class":75},[69,670,671],{"class":174},"WriteFile",[69,673,209],{"class":75},[69,675,212],{"class":75},[69,677,678],{"class":215},"invoice.pdf",[69,680,212],{"class":75},[69,682,191],{"class":75},[69,684,685],{"class":187}," data",[69,687,191],{"class":75},[69,689,690],{"class":340}," 0o644",[69,692,693],{"class":75},");",[69,695,194],{"class":187},[69,697,230],{"class":75},[69,699,233],{"class":75},[69,701,181],{"class":75},[69,703,705,707,709,711,713,715],{"class":71,"line":704},39,[69,706,241],{"class":187},[69,708,203],{"class":75},[69,710,246],{"class":174},[69,712,209],{"class":75},[69,714,251],{"class":187},[69,716,160],{"class":75},[69,718,720],{"class":71,"line":719},40,[69,721,259],{"class":75},[69,723,725],{"class":71,"line":724},41,[69,726,727],{"class":75},"}\n",[18,729,730,731,734,735,739,740,742,743,746,747,203],{},"Download the ",[43,732,733],{},"IPAex00401.zip"," from ",[22,736,738],{"href":24,"rel":737},[26],"moji.or.jp/ipafont",", extract ",[43,741,45],{},", drop it next to ",[43,744,745],{},"main.go",", and ",[43,748,749],{},"go run main.go",[13,751,753],{"id":752},"which-ipa-file-is-the-right-one","Which IPA file is the right one",[18,755,756],{},"Open the zip and you get three TTFs plus a license. People mix these up constantly:",[758,759,760,773],"table",{},[761,762,763],"thead",{},[764,765,766,770],"tr",{},[767,768,769],"th",{},"File",[767,771,772],{},"What it is",[774,775,776,790,803],"tbody",{},[764,777,778,783],{},[779,780,781],"td",{},[43,782,45],{},[779,784,785,789],{},[786,787,788],"strong",{},"IPAex Gothic"," — sans-serif, proportional Latin. Use this for most documents.",[764,791,792,797],{},[779,793,794],{},[43,795,796],{},"ipaexm.ttf",[779,798,799,802],{},[786,800,801],{},"IPAex Mincho"," — serif, proportional Latin. Use for body text in long-form documents or to pair with Gothic for emphasis.",[764,804,805,810],{},[779,806,807],{},[43,808,809],{},"ipag.ttf",[779,811,812,815,816,819],{},[786,813,814],{},"IPA Gothic"," (no \"ex\") — sans-serif, ",[786,817,818],{},"monospace Latin",". Rarely what you want today.",[18,821,822],{},"The \"ex\" in IPAex stands for \"extended proportional.\" The original IPA fonts put Latin characters on fixed CJK-width grids, which made mixed J/E text look stretched. IPAex fixes that by making Latin characters proportional while keeping CJK characters on the normal grid. For any document with English loan words, URLs, or numbers — which is basically every business document in Japan — you want IPAex.",[18,824,825,826,828],{},"If you inherited a project using ",[43,827,809],{}," because the engineer who picked the font did it before IPAex existed (original IPA Gothic: 2003, IPAex: 2010), the switch is one file swap. Same family name, same everything else.",[13,830,832],{"id":831},"no-bold-file-now-what","No Bold file — now what",[18,834,835],{},"IPAex ships exactly one weight per family: Regular. That's unusual compared to Noto Sans JP (nine weights) and it's the single biggest reason people look at IPAex and decide it won't work for their design.",[18,837,838],{},"Two ways to handle it in gpdf:",[18,840,841,844,845,847],{},[786,842,843],{},"Synthesized bold."," ",[43,846,53],{}," applies a stroke overlay on Regular glyphs. Typographically it's a cheat — real bold weights have redrawn outlines with thicker strokes, not Regular traced twice. But for invoice headings and table labels at 10 pt or larger, synthesized bold is indistinguishable to most readers:",[60,849,851],{"className":62,"code":850,"language":64,"meta":65,"style":65},"c.Text(\"合計金額\", template.Bold())\n",[43,852,853],{"__ignoreMap":65},[69,854,855,857,859,861,863,865,868,870,872,874,876,878],{"class":71,"line":72},[69,856,483],{"class":187},[69,858,203],{"class":75},[69,860,507],{"class":174},[69,862,209],{"class":75},[69,864,212],{"class":75},[69,866,867],{"class":215},"合計金額",[69,869,212],{"class":75},[69,871,191],{"class":75},[69,873,521],{"class":187},[69,875,203],{"class":75},[69,877,541],{"class":174},[69,879,544],{"class":75},[18,881,882,885],{},[786,883,884],{},"Pair with IPAex Mincho."," The classic Japanese typography move for emphasis isn't bold — it's a serif/sans switch. Register both families:",[60,887,889],{"className":62,"code":888,"language":64,"meta":65,"style":65},"gothic,  _ := os.ReadFile(\"ipaexg.ttf\")\nmincho, _ := os.ReadFile(\"ipaexm.ttf\")\n\ndoc := gpdf.NewDocument(\n    gpdf.WithFont(\"IPAexGothic\", gothic),\n    gpdf.WithFont(\"IPAexMincho\", mincho),\n    gpdf.WithDefaultFont(\"IPAexGothic\", 10.5),\n)\n\npage.AutoRow(func(r *template.RowBuilder) {\n    r.Col(12, func(c *template.ColBuilder) {\n        c.Text(\"請求書\", template.FontFamily(\"IPAexMincho\"), template.FontSize(24))\n        c.Text(\"ご請求内容は下記の通りです。\")\n    })\n})\n",[43,890,891,919,947,951,966,990,1014,1036,1040,1044,1069,1100,1149,1168,1172],{"__ignoreMap":65},[69,892,893,896,898,901,903,905,907,909,911,913,915,917],{"class":71,"line":72},[69,894,895],{"class":187},"gothic",[69,897,191],{"class":75},[69,899,900],{"class":187},"  _ ",[69,902,197],{"class":75},[69,904,200],{"class":187},[69,906,203],{"class":75},[69,908,206],{"class":174},[69,910,209],{"class":75},[69,912,212],{"class":75},[69,914,45],{"class":215},[69,916,212],{"class":75},[69,918,160],{"class":75},[69,920,921,924,926,929,931,933,935,937,939,941,943,945],{"class":71,"line":83},[69,922,923],{"class":187},"mincho",[69,925,191],{"class":75},[69,927,928],{"class":187}," _ ",[69,930,197],{"class":75},[69,932,200],{"class":187},[69,934,203],{"class":75},[69,936,206],{"class":174},[69,938,209],{"class":75},[69,940,212],{"class":75},[69,942,796],{"class":215},[69,944,212],{"class":75},[69,946,160],{"class":75},[69,948,949],{"class":71,"line":90},[69,950,87],{"emptyLinePlaceholder":86},[69,952,953,956,958,960,962,964],{"class":71,"line":100},[69,954,955],{"class":187},"doc ",[69,957,197],{"class":75},[69,959,275],{"class":187},[69,961,203],{"class":75},[69,963,280],{"class":174},[69,965,283],{"class":75},[69,967,968,971,973,975,977,979,981,983,985,988],{"class":71,"line":112},[69,969,970],{"class":187},"    gpdf",[69,972,203],{"class":75},[69,974,354],{"class":174},[69,976,209],{"class":75},[69,978,212],{"class":75},[69,980,361],{"class":215},[69,982,212],{"class":75},[69,984,191],{"class":75},[69,986,987],{"class":187}," gothic",[69,989,306],{"class":75},[69,991,992,994,996,998,1000,1002,1005,1007,1009,1012],{"class":71,"line":122},[69,993,970],{"class":187},[69,995,203],{"class":75},[69,997,354],{"class":174},[69,999,209],{"class":75},[69,1001,212],{"class":75},[69,1003,1004],{"class":215},"IPAexMincho",[69,1006,212],{"class":75},[69,1008,191],{"class":75},[69,1010,1011],{"class":187}," mincho",[69,1013,306],{"class":75},[69,1015,1016,1018,1020,1022,1024,1026,1028,1030,1032,1034],{"class":71,"line":127},[69,1017,970],{"class":187},[69,1019,203],{"class":75},[69,1021,380],{"class":174},[69,1023,209],{"class":75},[69,1025,212],{"class":75},[69,1027,361],{"class":215},[69,1029,212],{"class":75},[69,1031,191],{"class":75},[69,1033,393],{"class":340},[69,1035,306],{"class":75},[69,1037,1038],{"class":71,"line":137},[69,1039,160],{"class":75},[69,1041,1042],{"class":71,"line":147},[69,1043,87],{"emptyLinePlaceholder":86},[69,1045,1046,1049,1051,1053,1055,1057,1059,1061,1063,1065,1067],{"class":71,"line":157},[69,1047,1048],{"class":187},"page",[69,1050,203],{"class":75},[69,1052,436],{"class":174},[69,1054,439],{"class":75},[69,1056,443],{"class":442},[69,1058,446],{"class":75},[69,1060,449],{"class":79},[69,1062,203],{"class":75},[69,1064,454],{"class":79},[69,1066,457],{"class":75},[69,1068,181],{"class":75},[69,1070,1071,1074,1076,1078,1080,1082,1084,1086,1088,1090,1092,1094,1096,1098],{"class":71,"line":163},[69,1072,1073],{"class":187},"    r",[69,1075,203],{"class":75},[69,1077,470],{"class":174},[69,1079,209],{"class":75},[69,1081,475],{"class":340},[69,1083,191],{"class":75},[69,1085,480],{"class":75},[69,1087,483],{"class":442},[69,1089,446],{"class":75},[69,1091,449],{"class":79},[69,1093,203],{"class":75},[69,1095,492],{"class":79},[69,1097,457],{"class":75},[69,1099,181],{"class":75},[69,1101,1102,1105,1107,1109,1111,1113,1115,1117,1119,1121,1123,1126,1128,1130,1132,1134,1136,1138,1140,1142,1144,1146],{"class":71,"line":168},[69,1103,1104],{"class":187},"        c",[69,1106,203],{"class":75},[69,1108,507],{"class":174},[69,1110,209],{"class":75},[69,1112,212],{"class":75},[69,1114,514],{"class":215},[69,1116,212],{"class":75},[69,1118,191],{"class":75},[69,1120,521],{"class":187},[69,1122,203],{"class":75},[69,1124,1125],{"class":174},"FontFamily",[69,1127,209],{"class":75},[69,1129,212],{"class":75},[69,1131,1004],{"class":215},[69,1133,212],{"class":75},[69,1135,534],{"class":75},[69,1137,521],{"class":187},[69,1139,203],{"class":75},[69,1141,526],{"class":174},[69,1143,209],{"class":75},[69,1145,531],{"class":340},[69,1147,1148],{"class":75},"))\n",[69,1150,1151,1153,1155,1157,1159,1161,1164,1166],{"class":71,"line":184},[69,1152,1104],{"class":187},[69,1154,203],{"class":75},[69,1156,507],{"class":174},[69,1158,209],{"class":75},[69,1160,212],{"class":75},[69,1162,1163],{"class":215},"ご請求内容は下記の通りです。",[69,1165,212],{"class":75},[69,1167,160],{"class":75},[69,1169,1170],{"class":71,"line":222},[69,1171,596],{"class":75},[69,1173,1174],{"class":71,"line":238},[69,1175,1176],{"class":75},"})\n",[18,1178,1179],{},"That's the look you see on Japanese wedding invitations and formal reports — Mincho for titles, Gothic for body. If your document is going to a government office, this is probably the expected combination anyway.",[13,1181,1183],{"id":1182},"the-ipa-font-license-briefly","The IPA Font License, briefly",[18,1185,1186,1187,1192],{},"IPAex is not SIL OFL. It's the ",[22,1188,1191],{"href":1189,"rel":1190},"https://opensource.org/licenses/IPA",[26],"IPA Font License Agreement v1.0",", which is OSI-approved and mostly permissive but has two asks worth naming:",[1194,1195,1196,1211],"ol",{},[1197,1198,1199,1202,1203,1206,1207,1210],"li",{},[786,1200,1201],{},"Preserve the license text"," wherever you ship the font binary. If you ",[43,1204,1205],{},"//go:embed"," the TTF, also embed the license file. A project-root ",[43,1208,1209],{},"LICENSES/IPA-FONT-1.0.txt"," satisfies this for most distributions.",[1197,1212,1213,1216,1217,1220],{},[786,1214,1215],{},"Don't rename the font."," If you modify the TTF itself and redistribute it, you must give the derivative a different name (not containing \"IPA\" or \"IPAex\"). Note: this restriction does ",[786,1218,1219],{},"not"," apply to glyph subsetting performed at render time. Article 3.4 of the license explicitly exempts output documents created using the font from the naming restriction.",[18,1222,1223,1224,1227],{},"Meaning: gpdf's subsetting at ",[43,1225,1226],{},"doc.Generate()"," is fine. The subset font embedded in your PDF doesn't need a different name and doesn't trigger the \"Derivative Font Program\" clauses. You are creating a document, not redistributing a font.",[18,1229,1230],{},"One thing to flag for contributors building gpdf itself: we avoid shipping IPAex in the gpdf repo (golden file tests use SIL OFL fonts like Noto) precisely so downstream users never have to think about license compatibility with their repo's top-level LICENSE. If you use IPAex in your application, that's your project's choice, not ours.",[13,1232,1234],{"id":1233},"when-to-pick-ipaex-over-noto-sans-jp","When to pick IPAex over Noto Sans JP",[758,1236,1237,1249],{},[761,1238,1239],{},[764,1240,1241,1244,1246],{},[767,1242,1243],{},"Dimension",[767,1245,788],{},[767,1247,1248],{},"Noto Sans JP",[774,1250,1251,1262,1273,1284,1298,1309],{},[764,1252,1253,1256,1259],{},[779,1254,1255],{},"Weights shipped",[779,1257,1258],{},"1 (Regular)",[779,1260,1261],{},"9 (Thin → Black)",[764,1263,1264,1267,1270],{},[779,1265,1266],{},"License",[779,1268,1269],{},"IPA Font License v1.0",[779,1271,1272],{},"SIL OFL 1.1",[764,1274,1275,1278,1281],{},[779,1276,1277],{},"Latin handling",[779,1279,1280],{},"Proportional (IPAex) or monospace (IPA)",[779,1282,1283],{},"Proportional",[764,1285,1286,1289,1295],{},[779,1287,1288],{},"Pre-installed on",[779,1290,1291,1292],{},"Some JP Linux distros, TeX Live ",[43,1293,1294],{},"ptex-fonts",[779,1296,1297],{},"Android, ChromeOS",[764,1299,1300,1303,1306],{},[779,1301,1302],{},"Typical audience",[779,1304,1305],{},"Japanese government, legal, academic",[779,1307,1308],{},"Consumer web, international",[764,1310,1311,1314,1317],{},[779,1312,1313],{},"File size",[779,1315,1316],{},"7.5 MB (Gothic)",[779,1318,1319],{},"5 MB (Regular only)",[18,1321,1322],{},"Pick IPAex when your output crosses a Japanese institutional boundary — e-Tax PDF submissions, court filings, academic paper submissions to a Japanese journal — because graders, reviewers, and OCR tools in those ecosystems are calibrated against IPA. Pick Noto Sans JP for everything else. They render very similarly; the choice is about ecosystem fit, not aesthetics.",[13,1324,1326],{"id":1325},"related-reading","Related reading",[1328,1329,1330,1337,1344,1351],"ul",{},[1197,1331,1332,1336],{},[22,1333,1335],{"href":1334},"/blog/embed-japanese-font","How do I embed a Japanese font in gpdf?"," — the general recipe, works for any CJK TTF",[1197,1338,1339,1343],{},[22,1340,1342],{"href":1341},"/blog/noto-sans-jp-with-gpdf","How do I use Noto Sans JP with gpdf?"," — the SIL OFL alternative with nine weights",[1197,1345,1346,1350],{},[22,1347,1349],{"href":1348},"/blog/tofu-boxes-japanese","Why does my PDF show tofu boxes for Japanese?"," — troubleshooting when glyphs aren't showing up",[1197,1352,1353,1358,1359,1361],{},[22,1354,1357],{"href":1355,"rel":1356},"https://gpdf.dev/docs/guide/fonts",[26],"Fonts guide"," — full ",[43,1360,354],{}," reference including variant naming",[13,1363,1365],{"id":1364},"try-gpdf","Try gpdf",[18,1367,1368],{},"gpdf is a Go library for generating PDFs. MIT licensed, zero external dependencies, native CJK support.",[60,1370,1374],{"className":1371,"code":1372,"language":1373,"meta":65,"style":65},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","go get github.com/gpdf-dev/gpdf\n","bash",[43,1375,1376],{"__ignoreMap":65},[69,1377,1378,1380,1383],{"class":71,"line":72},[69,1379,64],{"class":79},[69,1381,1382],{"class":215}," get",[69,1384,1385],{"class":215}," github.com/gpdf-dev/gpdf\n",[18,1387,1388,1392,1393],{},[22,1389,1391],{"href":31,"rel":1390},[26],"⭐ Star on GitHub"," · ",[22,1394,1397],{"href":1395,"rel":1396},"https://gpdf.dev/docs/quickstart",[26],"Read the docs",[1399,1400,1401],"style",{},"html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":65,"searchDepth":83,"depth":83,"links":1403},[1404,1405,1406,1407,1408,1409,1410,1411,1412],{"id":15,"depth":83,"text":16},{"id":37,"depth":83,"text":38},{"id":57,"depth":83,"text":58},{"id":752,"depth":83,"text":753},{"id":831,"depth":83,"text":832},{"id":1182,"depth":83,"text":1183},{"id":1233,"depth":83,"text":1234},{"id":1325,"depth":83,"text":1326},{"id":1364,"depth":83,"text":1365},"2026-04-17","Register ipaexg.ttf with gpdf.WithFont. IPAex Gothic ships a single Regular weight under the IPA Font License — bold emphasis has to be synthesized or paired.",false,"md",{"name":1418,"totalTime":1419,"tools":1420,"steps":1423},"Use IPAex Gothic as the default font in a gpdf document","PT10M",[1421,1422],"Go 1.22+","ipaexg.ttf (IPAex Gothic v4.01 from moji.or.jp)",[1424,1427,1430,1433,1436],{"name":1425,"text":1426},"Download the IPAex font archive from moji.or.jp","Grab the IPAex00401.zip from moji.or.jp/ipafont. Unzip and keep ipaexg.ttf (Gothic) and the IPA Font License Agreement v1.0 text file that travels with it.",{"name":1428,"text":1429},"Load the TTF bytes","Use os.ReadFile(\"ipaexg.ttf\") to load the font into a []byte at program start. For container deployments, //go:embed keeps the font inside the Go binary.",{"name":1431,"text":1432},"Register the font at document construction","Pass gpdf.WithFont(\"IPAexGothic\", fontBytes) and gpdf.WithDefaultFont(\"IPAexGothic\", 10.5) to gpdf.NewDocument. 10.5 pt matches the default size Word uses for Japanese documents.",{"name":1434,"text":1435},"Handle bold emphasis without a Bold file","IPAex Gothic has no Bold variant. Either synthesize bold with template.Bold() (gpdf applies a 0.4 pt stroke overlay) or register IPAex Mincho as a separate family for emphasis.",{"name":1437,"text":1438},"Keep the license notice with your distribution","The IPA Font License v1.0 requires preserving the license text wherever the font binary ships. If you //go:embed the TTF, embed the license alongside it and reference it from LICENSES/NOTICE.",null,{},"/blog/ipaex-gothic-gpdf",{"title":5,"description":1414},"blog/009.ipaex-gothic-gpdf",[1445,1446,1447],"recipe","cjk","tutorial","MT9s2SZvJpmof-qrvnFeO4uEtYvwB7hPRkOjr_X7hto",1776529258773]