curvednebula / apibake-js

Convert OpenAPI to PDF.
https://curvednebula.com/apibake
24 stars 3 forks source link

Please allow users to specify fonts #1

Closed kth-tw closed 1 year ago

kth-tw commented 1 year ago

My swagger.json include some Chinese word. It generate pdf like here

image

If I change here from

'Helvetica'

to

`${process.env.HOME}/Library/Fonts/NotoSansMonoCJKtc-Regular.otf`

it can show Chinese successfully.

Can you add a cli argument to set font?

curvednebula commented 1 year ago

Thanks! Yes, font configuration will be added to apibake-config.json. See --export-config option.

kth-tw commented 1 year ago

Another question:

I have summary and description in json, but I can't find in generated pdf document.

curvednebula commented 1 year ago

I think descriptions of exact HTTP responses (200, 300, 400, etc.) are displayed. But not the overall description of the REST API endpoint itself. Let me take a look.

curvednebula commented 1 year ago

API summary and description added in 0.1.19 - let me know if this fixes your problem. Custom fonts will be added a bit later - need to come up with proper config structure for that.

kth-tw commented 1 year ago

Thanks for upgrading.

There is summary and description now.

image
curvednebula commented 1 year ago

Font configuration is added in 0.1.21 - check readme for more details.

kth-tw commented 1 year ago

Thanks for upgrading. It work.