Butwith all the base styling from bootstrap, you have to pick a specific element that you want to override. And you have to use correct font-weight coding, such as medium not being a valid value. I'm not sure what you are trying to accomplish with medium, as I would assume medium being the default which is value 400 or normal. With the link I posted you should get a better understanding of correct font-weight coding.
PS: Not really sure what information I could give or not give to help, but if you'd like to have a poke around, all of my code is sitting here - the bugged view is "ExportPDF" and the template is export.html in the "online_cv" app_dir: -Summer-Project-Blog
That's interesting -- it sound like Weasyprint isn't loading the font from the link, which does surprise me a bit. However, if you download the TTF version of Roboto then you can install it into your PythonAnywhere account.
Yeah I tried that with Segoe UI as that was the default bootstrap font being used. Tried it again with the roboto ttfs, and sure enough, fc-cache -f -v gives the result /home/Kirkmania/.fonts: caching, new cache contents: 16 fonts, 0 dirs, but WeasyPrint still isn't using it. I don't know what else to do! Maybe I need to explore the WeasyPrint code and see what I can understand.
OK, that's promising -- the fonts are definitely installed where weasyprint should be able to get hold of them. Are there any warning messages appearing in your website's server or error log when you access the view?
First time I'm seeing these errors anywhere, and they don't show up when I access any other views, despite those same stylesheets being requested in every template I use. I checked the directory to make sure that blog.css is where it's supposed to be in static/css and it definitely is there.
EDIT2: Alright, so I downloaded bootstrap css and just threw it in my static/css directory, so now I'm just getting two timeout errors instead. Clearly the issue is something to do with how weasyprint gets static files, I'm just not sure how to fix it. Maybe something to do with the url_fetcher? It still works fine on local which confuses me the most.
Accessing web resources in a free account needs to be done through the proxy. You will need to check the docs weasyprint and django-weasyprint to see how to configure it to use a proxy to access resources on the web. The details that you need to configure it with are here:
I was originally using a NPM package called typeface-roboto to load my font. This was awesome because I wanted to host the fonts myself instead of pulling from a CDN. I realized the styles included in the package was the reason for my Flash of Unstyled Text (FOUT).
I noticed the @font-face styles were using font-display: swap;. When swap is set, the browser will give a very short time to load the font before it uses a fallback. Once the font is fully loaded, it will convert back to the expected font. This option is great from a performance standpoint but might affect user experience. If you set font-display: block, this will increase the amount of time the browser will have to fetch your fonts before it starts displaying anything on the page. block sacrifices performance for user experience.
Roboto was designed in-house by Christian Robertson for Google in 2011. The sans-serif typeface is the default font for not only Android, but also other Google services such as Google Play, YouTube, Google Maps, and Google Images.
Roboto belongs to the neo-grotesque genre of sans-serif typefaces. It includes thin, light, regular, medium, bold, and black weights, with matching oblique styles. Its forms are largely geometric, with open curves and straight-sided capitals.
The wonderful Cleon Sans doesn't offer as many font weights as some of the other fonts featured here, but when you need a font similar to Roboto, it will not disappoint. Cleon offers the full complement of upper and lowercase characters, numbers, punctuation, and multilingual support.
With a total of 329 glyphs included, Luxora Grotesk is an excellent choice for anyone looking for a font similar to the Roboto sans serif family. This minimalist typeface offers seven different weights, each with an italic version.
Ageo is a bit more rounded than Roboto but nevertheless is a terrific option when you are looking for a similar font. This beautiful geometric sans serif includes eight weights from thin to heavy, each with matching italics.
Metrisch is another great option when you're in the market for a font similar to Roboto, albeit with a more geometric look. Aside from a large selection of weights with matching italic versions, Metrisch is fully loaded with OpenType features like stylistic alternates, case-sensitive forms, fractions, small capitals, and more.
LiteON offers a full selection of upper and lowercase characters, numbers, punctuation, ligatures, alternates, and multilingual support. It also includes six weights and is an excellent alternative to Roboto when you need one.
Where Boilover is restrained, Neuva is extravagant, and that's why this elegant and stylish font complements Boilover so well. Use Neuva for headlines and leave the more legible and simple Boilover to carry your body text.
You can't go wrong when you pair the wild and stunning Mistont with the clean and understated Luxury. With its smooth curves and beautiful ligatures, Mistont is designed to grab attention, while Luxora is designed to help you keep it.
Whether you are using Just Sans light or bold weights, Sophitta Script offers a great pairing. Its flowing lines and bouncing baseline offer the natural touch we associate with handwriting, which plays well with the more restrained, clean lines of Just Sans.
How about Baker Street Black as an excellent pairing for Ageo? The handcrafted Baker Street offers four different styles, so you have plenty of choice when it comes to determining what you want your text to look like.
Metrisch's simplicity means that you can really go for it when choosing a complementary font. Kenjo is a Japanese inspired font that, though quite legible, offers a level of stylistic complexity that balances well with Metrisch.
With its smooth curves and beautiful ligatures, Rengok is hard to beat as an excellent complement for the clean, simple lines of LiteON. Rengok makes an excellent choice for headlines, while LiteON is a great choice for body text.
Slabien is one of those fonts similar to Roboto Slab that offers the characteristic heaviness of the slab serif. Thus the light and airy Octavina Script complements it beautifully. Octavina Script features 394 glyphs and 216 alternate characters within its OpenType features, which means that you have plenty of room to experiment in creating the exact look you need.
Whether you're looking for a similar font to Roboto or terrific Roboto font pairings, Envato Elements is your number one source. Head on over and download as many fonts as you want, all for the price of one subscription.
3a8082e126