On the web, what fonts should I use to create an equivalent experience cross-platform?
Here are some good up-to-date listings of the most-installed fonts for PC, Mac, and Linux:
Sans serif font sampler and survey results
Serif font sampler and survey results
Hope this helps your decision!
Is there a cross platform, cross browser keyword I can use that refers to the system font?
No, Not in my knowledge but there is a solution
/* System Fonts as used by GitHub */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}
or
/* Define the "system" font family */
@font-face {
font-family: system;
font-style: normal;
font-weight: 300;
src: local(".SFNSText-Light"), local(".HelveticaNeueDeskInterface-Light"), local(".LucidaGrandeUI"), local("Ubuntu Light"), local("Segoe UI Light"), local("Roboto-Light"), local("DroidSans"), local("Tahoma");
}
/* Now, let's apply it on an element */
body {
font-family: "system";
}
Source: https://css-tricks.com/snippets/css/system-font-stack/
Crossplatform way to get a list of available fonts?
No, that is NOT the right way. However, the problem is that there really isn't a right way, short of standardising on something like freetype or writing your own library with lots of backends for different operating systems.
To be more clear: most operating systems have bitmapped fonts, outline fonts, different font encodings, various other font formats which occur, but aren't as well supported, or are supported via some additional plugins, non-alphabetic fonts (think of Wingdings, chess pieces, etc.), colored fonts, TeX fonts, postscript fonts, 3D fonts, etc.
Furthermore, you may not even have a standard way of listing them. Most operating systems list fonts by name and size, for instance, but the X Window System traditionally listed fonts by a lot of column headings, including their weight, whether they were sans/serif, fixed/variable spacing, italic vs. oblique, etc.
FURTHERMORE, you have issues like user fonts vs. system-wide fonts, and even network fonts, and font servers, and now web fonts.
In short, fonts are complicated. It's for reasons like this, that libraries like freetype exist. I'd suggest just using one.
BUT, if you do want a quicker, more hackish solution, then listing those dirs is a start. You should probably make the two methods you mention two possible back ends, with default backends chosen for Linux vs. windows, but perhaps the possibility of listing /usr/share/X11/fonts, or listing fonts via defoma, for example, instead.
Fonts in a multi-platform environment
fontconfig is a cross-platform library for finding fonts by either direct name (Times Roman) or common aliases like serif - it's what most modern Linux software, like the GNOME & KDE desktops, use to find fonts, and is used in conjunction with libraries like Pango for text layout and FreeType for font rasterizing.
Is there a way to know what fonts to use on the web?
Good sites are here:
http://www.csstypeset.com/
http://www.typetester.org/ - powerful
list of safe fonts for MODERN browsers
Font selection has nothing do to with how modern the browser is. Font selection is limited to what is installed by default on Windows/Mac OS X/Linux.
However, with modern browsers, you have the option to embed custom fonts using the CSS @font-face
declaration. If you decide to embed a font using CSS, make sure that the font's license permits you to do so. Font Squirrel & Google Web Fonts have a large collection of embeddable fonts.
How to use linux fonts in windows Qt?
You can use QFontDatabase::addApplicationFont to load a font from a file or from memory (QByteArray). The returned id can be used to retrieve a list of font families (see QFontDatabase::applicationFontFamilies) that can be passed to QFontDatabase::font to create a QFont object for use in your application.
Only TrueType fonts are supported.
What are the best practices for making a website usable and consistent across all devices and screen sizes?
From what I've gathered (been researching it myself) it's really a combination of everything. Liquid layouts work great for different monitor sizes, while media queries help target mobile and tablet devices. I've been looking the 978 Grid System to format a few websites I'm working on. It has grids for several devices, but part of me thinks it might be a bit too bulky for what I want to do.
Related Topics
Background-Position Percentage Not Working
How to Use a Data Attribute to Set a Background-Image in CSS
What Is That Thing Between CSS "Selectors" Called
Has the ::-Webkit-Selection Selector Ever Been Supported
Label Next to Selectinput in Shiny
Svg + CSS3 Animation Not Working with Link Markup
404 Errors on Bundled Jquery CSS, VS2012 Publishing to Azure
Change the Default Responsive Navbar Breakpoint
Why Doesn't My Child Element Inherit Color from Its Parent When Parent Has More Specific Selector
Flex Item with Image Child Doesn't Adjust Its Size Properly
How Add Class to Parent in Angular Application
Wrapping a Text Around a Circular Element
Bootstrap: How to Collapse Navbar Earlier
CSS Vertical-Align: Text-Bottom;
Remove Bounce on Scroll in Browser, Issue with Position:Fixed Div
Fixed Element Disappears in Chrome