How to increase the font size for code samples in sphinx? - css

When i want to display some with fixed-width font in Sphinx, i place it between two inverted ticks ("inline markup for code samples"):
The class ``Test1`` is pure virtual.
Unfortunately, the size of this font is much smaller than the font for normal text:
Searching for a method to increase this font i found the post
How do I increase the fixed width font size in Sphinx / reStructured Text? ,
but i think it is out of date (2014), because the solutions given there seem not to work - for instance, the file default.css_t does not exist in my installation.
I also tried to modify /build/html/_static/basic.css, but after doing build html my changes have vanished and everything looked like it did before.
How can i change the font size of code samples in the current version of sphinx (4.4.0)?

Related

How to change the font size of only the console panel in RStudio?

I have found other posts showing how to change the font size of only the Help panel, and I know how to Zoom In and Out via keyboard shortcuts, or by using the long way.
I also know that you can change the font size of the editor in the Appearances option.
However, I would like to reduce the font size of only the console panel.
I would like to keep my editor font nice and big, but the console one is mostly for checking out quick data.frames so the smaller the better.
I tried fiddling around the source code of Rstudio to no avail.
Thank you in advance!

Using the same font size or width px in Wicked pdf shows differently in MAC and Ubuntu

I use wicked pdf for generating pdf in my ruby on rails project. I set CSS in the part in show.pdf.erb.
I use the same font-size px for p or same width or height px, however, in Ubuntu system it's much bigger than in the Mac system. I set the same page_size: 'Letter', may I know how to solve this? Is that because of the resolution or retina of Mac? Even if I use em or % for the font size or width, it still looks very different in Mac and Ubuntu. I want to make a business card size div with some content inside no matter people use Mac to open and print the pdf or Ubuntu.
Wickedpdf on different platforms renders differently because of:
system fonts are different (this can be somewhat fixed by using custom web fonts)
systems have different DPI settings (this affects sizing the most, but can be tuned)
different font renderers and smoothing
For exact sizes it's better to use corresponding markup - with cm or in units.
Also for more control over resulting pdf - you may want to eliminate intermediate html render and use direct pdf rendering with something like prawn pdf

how many icons can I put in one icon font file?

I would like to know how many Icons can I put in one icon font?
what is the best method to have the biggest amount of icons in one icon font file?
Icon fonts define glyphs for Unicode code points, and therefore the theoretical limit is around 1 million icons, because that is the number of code points that can be encoded.
Font formats may be limited to a certain number of symbols however. But even 1000 icons in a single font, which every format should support, are way too many for real world web applications because of the size and performance loss.
So far FontAwesome has managed to squeeze 439 icons in a font. I guess when you run out of characters you can always make another font file and add that to your page as well.

css: setting the proportion of font icons (other then font size)

We use custom icon font (inhouse font generated to icons with icomoon, or something similiar) in our webapp. I can set their size with font-size css property. but sometimes I need to adjust more proprties: for example increase the width or the height of the icon/font etc. Is there a way to do this with css/js?
I'll be glad for help with this, generating a specific font for each mini used isn't a path I would like to choose
font-stretch was supposed to do that but is not included in any current css standard and not supported by any browsers. I think you will have to create seperate icons for that case, sorry.
I did a Google Search trying to find the appropriate css descriptors, and stumbled upon this thread. Maybe it may help: Is it possible to change the font height, not just the line-height?

QT: Fonts and their width

I have windows that are fixed in size, under which I have textual labels. Although I use the same font, the fonts look different on windows, mac and linux, up to the point where I can't rely on where a label will end, even though the string and the font size are a constant in my application.
Is there any solution to that? Someone mentioned embedding TTF fonts and using them, but is that really necessary?
There is no font you can rely on being available on all platforms, and height/width ratios for different strings will differ for different fonts (fixed-width being slightly better). Additionally, things like different DPI settings will cause you headaches even if using the same font. I would rather reconsider whether your widgets really should be fixed size and you need those assumptions about the font size at all. In almost all cases, your UI will be more usable, readable and consistent with the rest of the desktop if you use flexible layouts and stick to whatever font and font size the platform suggests.
You can use QFont::setPixelSize to guarantee a consistent font size across platforms.
Since the goal is to keep a line of text label from drawing over and out of the window bounds, one solution is to adjust the font size used at runtime.
QFontMetrics provides boundingRect() family of calls to find how must space a text string will take when drawing in a given font. With those, you can test if the string can fit in the space. If it doesn't fit, reduce the font size and test again.

Resources