Pygame Font not consistent - pygame

I'm working on a program in python+pygame with some other developers, and we're seeing the same font rendered differently. It's a free font that we're distributing with the game. On my machine, this particular font is rendering 10px lower than on another developer's machine.
Any thoughts on why this is?

I encountered the same problem but it was when using too different releases of the pygame stuff (especially the truetype library), try to compare the versions of pygame, sdl, sdl-ttf and the freetype library.

It's a free font that we're distributing with the game.
But whilst you are prototyping and building the program, are you referencing the font file from a local directory within the project, or are you just using the same font, but 'installed' on each machine?
If so, it could be that one machine has a slightly differing version of the font. Try and use the font just from a directory in the project and see if that helps.
Otherwise, it could be some crazy ClearType / TrueType settings or font anti-aliasing or something. I would have no idea how to fix that. Maybe try converting it to a different file format?

To test: Place a copy of the font the same folder as a python script.
Or maybe similar font is being loaded.

Pygame uses te installed fonts on your operating system: maybe you have some different fonts installed or not installed? If so then it will default to a different font than you expect.

Related

Website shown different on Macbook than on Windows

I really don't know what to do so I hope that maybe one of you can find the solution for this issue:
https://www.schwitzen.bubblfy.com/
This wordpress website is shown different on Windows than on Mac. So on my Windows Computer I am using Google Chrome. And even on Firefox it is the same site.
But when I use the website on a MAC, it looks completely different. (Not the same font, not the same margin, etc..)
At the beginning I thougt, that maybe MAC's Safari Browser is the reason for this but even when I open Firefox on the MAX, it looks different. Why?
How can I adjust the site so, that it looks like on the Windows Version?
Hope you can help me!
Kind regards
The browsers use fonts preintsalled in operating system and display text via font-family css.
The different operating systems have different font families pre-installed, and when a certain font is missing, it is silently substituted with another. Moreover, the font that is used for substitution may be a native to the OS and specific to that particular OS only.
The same font size can be displayed differently on different OS.
Besides fonts, there might be other problems of different website view such as rendering engine(webkit, presto...), browser version, client operating system, browser-specific code and etc.

Is it possible for front-end to know the local supported font-family?

I know we could define #fontface to download web-font. However, this could be problematic especially for chinese fonts due to its large size.
Yet in modern system, it's likely that it already installed some pre-set fonts. For example, a Windows might already installed fonts like SimHei, SimSun, NSimSun, FangSong, KaiTi, a Mac might installed fonts like Hiragino Sans GB, STHeiti Light, STHeiti, STKaiti.
So is it possible for a web-app to know what font this system had installed?
Take a look here it was the closed I could find (it may not be performant):
list every font a user's browser can display
Goodluck

Font Awesome does not work on any of my Windows 10 computers

I cannot get Font Awesome to work on any of my three Windows 10 machines. All my computers have been updated from 8.1. I don't know when it stopped working, here is what I do know:
Symptoms:
The font does not show. When double-clicked and opened with default Windows font viewer, it shows a default Arial-like typeface instead of slab serif Font Awesome
After installation, when browsed with Character Map - it again displays some kind of system-default font (and none of the icons)
Opened in Adobe programs it shows all alphanumeric characters and icons as blank square outlines.
So far I have tried:
Removing any and all font awesome files from the system and installing the font again
Installing just OTF, just TTF as well as both
Restarting, rebooting, system cleanup
Downloading older versions of the font
I am new to StackOverlow, so can't post images. Links below:
Double-clicking FontAwesome.otf file
Attempting to view in Character Map
EDIT: I had a friend with Windows 8.1 try it -- same problem!
One practical way is to convert .otf format to .ttf using Fontlab.
The solution is discussed here.
Font Awesome 5 is known to work on Windows 10. Here are instructions to install for Desktop Use. We recommend that you use the OTF files for desktop applications, because they support ligatures (i.e. type the icon name and the icon glyph appears).

Unwanted filled letters in webpage

I am using this great font from Fontsquirrel, Munro. (http://www.fontsquirrel.com/fonts/munro)
I wanted to use this font in a webpage of mine. I've put the .ttf file in a map named 'fonts' and referred to it in CSS.
nav a{
background:#9cf2e6;
display:inline-block;
color:#0;
text-decoration:none;
font-size:15px;
font-family:'Munro';
margin:13px 3%;
padding:7px 2%;
}
Then I noticed something. The O's in my webpage are filled. As you can see it shouldn't do this, because it did not do so in Photoshop or the webpage from Fontsquirrel. Also I tried to modify the font in Glyphs but there seems to be nothing wrong with it there.
My question: how will I undo the filled letters in this font? Is this a problem because it ain't a webfont from Typekit or Google fonts?
Thank you so much for all the help I can get.
I'm unable to reproduce this on Windows 7 (Chrome, Firefox, IE) with Munro installed locally. The letters display just fine (see image below). And I think that's the bigger issue: fonts not made for the web are likely to be rendered very differently across browsers and platforms (if at all). If you want to make sure these buttons look the same for all your users, stick to the images you created with Photoshop (and perhaps save them as PNG-8 with transparency rather than PNG-24 to shave off some kilobytes).
Technically, you can turn any TTF file into a web font, using FontSquirrel's Webfont Generator, for example. The font's license has to allow this, of course, because you'd essentially be redistributing the font. Just placing the TTF file in a /fonts/ folder and using font-family: Munro;, however, is not going to cut it, and only works for you because you have previously installed the font on your computer.
If I have, say, the Ubuntu font installed on my computer and I visit a webpage that references it in its stylesheet, my browser will not bother downloading it from the webserver, but instead loads it from my hard drive (or memory), which saves bandwidth and is much faster. I've also found that having a font installed locally can actually make it render differently than when it's loaded as a web font (e.g. WOFF).
So yes, it probably is a problem because this particular font is not very web-friendly, but even with web-friendly fonts, like those available through TypeKit or Google Fonts, you can still run into rendering differences (most noticeably between Windows and Mac). While it may be a fun exercise to try and recreate the images using just CSS, you're probably better off saving these buttons as images, or using a font that is web-friendly. Something from the Monospace category in Google Fonts, perhaps?
http://i.stack.imgur.com/9SuMr.png (Windows 7, Chrome)

Why do only some of my system fonts work in my HTML?

I have Din Engshrift and other obscure fonts installed on my machine where I do development. But when I try to access them from HTML, they look completely warped. Fonts like "Courier New" work fine. What causes that?
Using anything but standard-fonts is possibly only since very recently: http://www.tudy.ro/2008/09/02/embedded-web-fonts-are-back/.
It won't work in all browsers, though.
UPDATE:
This might be interesting, too: Typekit
DIN Engschrift is available in OTF, PS, and FF formats, for both the Mac and PC. It's possible that the browser you are using does not fully support the font format you have installed. Try adding the other formats, or try a different browser.
http://new.myfonts.com/fonts/urw/engschrift/
I assume you already realize that any HTML pages you make with unusual font5s will not render the same on a machine that lacks those fonts.
Supported fonts depend on the browser, though Firefox on my Mac apparently allows me to use any font available on my computer. However, since I am a Web developer and so I expect people who have different OSes to see my site, I am only using fonts that are "Windows/Mac Web-safe" (Mac OS X helpfully lists those as a collection in Font Book)
This isn't much, but world isn't ideal.
It's possible with CSS Fonts module to tell the browser to load a font you want (#font command), but the practical support isn't great.