8/12/2023 0 Comments Font vs typeface vs familyIn the above example, “serif” and “fantasy” are both generic family names provided at the end of the list, unquoted.įont family names that happen to be the same as a generic keyword value (“inherit”, “serif”, “sans-serif”, “monospace”, “fantasy”, and “cursive”) must be quoted to prevent confusion with the keywords with the same names. Since generic family names are keywords, they must not be quoted. The following generic family keywords are defined: ‘ serif‘, ‘ sans-serif‘, ‘ cursive‘, ‘ fantasy‘, and ‘ monospace‘. Generic family names are usually keywords. When multiple font family names are specified, designers are encouraged to include a generic font family name at the end of the list to provide fallback for when the desired font families are not available. To avoid mistakes in escaping, if a family name contains multiple words, separated by spaces, digits, or punctuation characters other than hyphens, it is recommended to list the family name in quotation marks (single or double):įont-family: "New Century Schoolbook", serif Ī generic family name is a name that is usually used as a fallback mechanism, which tells the browser what kind of font family to use in case none of the specified font families are available. For example, the following declarations are invalid:įont-family: "Lucida" Grande, sans-serif This means most punctuation characters and digits at the start of each token must be escaped in unquoted font family names. There are two types of font family names: font family names and generic family names.Ī font family name is a name of an actual font, such as “Helvetica”, “Arial”, “Times New Roman”, “Open Sans”, “Lato”, etc.įont family names must either be given quoted as strings, or unquoted as a sequence of one or more identifiers. If neither Helvetica nor Verdana is present, then the browser-defined sans serif font will be used. In the above example, if Helvetica is available it will be used when rendering. If none of the specified font families are available, the browser falls back to the default font specified in the system. If it is invalid or does not exits or if it fails to load the specified font, it tries to apply the second one, then the third, and the fourth, till the end of the list. The browser will first apply the first family name specified in the list. The browser will select the font from the list that is installed on the computer, or that can be downloaded using the information provided by an at-rule.įont-family: Helvetica, Verdana, sans-serif The font family names specified are separated by commas, indicating that they are alternatives to each other. More specifically, it defines a prioritized list of font family names and/or generic family names that are to be used. The font-family property specifies the font family that is to be used for the content of an element.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |