Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font selection for cells, headers, notes, etc. #302

Open
botan opened this issue Jul 8, 2024 · 4 comments
Open

Font selection for cells, headers, notes, etc. #302

botan opened this issue Jul 8, 2024 · 4 comments

Comments

@botan
Copy link

botan commented Jul 8, 2024

Thank you for this amazing package!

Sorry if this feature already exists, but I couldn't find it in the documentation. The only thing holding me back from fully migrating and using tinytable in production is not being able to use custom fonts. Are there any plans to enable this in the near future?

@vincentarelbundock
Copy link
Owner

Thanks for the kind words!

I'm curious about your use case. So far, I've taken the view that fonts are better set as a document property. Otherwise, people end up with tables with a different font from the text, and that is usually very ugly. Obviously, this is opinionated...

What output format are you using? If your are writing HTML tables, it is trivial to change the font using CSS (see tutorial).

@botan
Copy link
Author

botan commented Jul 8, 2024

Thanks for the quick reply!

I use Quarto for generating Word documents, but the tricky point is that my company's primary font is not monospace. Unsurprisingly, it doesn't look great in tables with number alignments. So, being able to specify a different font for the tables is quite handy in my case.

@vincentarelbundock vincentarelbundock changed the title Enable using custom fonts, preferably choosing different fonts for separate components Font selection for cells, headers, notes, etc. Jul 8, 2024
@vincentarelbundock
Copy link
Owner

Ah yes, I had not thought of that situation, but it makes total sense. Thanks for clarifying.

I don't want to make too many promises here. For HTML output, this would be relatively easy to add. For Word output, however, I expect this to be more difficult. The challenge is that tinytable creates a markdown table, and then uses Pandoc to convert it to a Word document. I have not researched this in detail, but I don't know of a way to use different fonts for different text in a pandoc-converted documented.

Setting a global font for the full table might be an easier goal to achieve in the medium run.

Note to self: If we do this, I'd like the solution to work in all output formats.

@botan
Copy link
Author

botan commented Jul 8, 2024

Wonderful, thank you for considering!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants