{"id":1213,"date":"2024-05-31T14:59:16","date_gmt":"2024-05-31T18:59:16","guid":{"rendered":"http:\/\/philsinatra.net\/blog\/?p=1213"},"modified":"2024-05-31T15:00:16","modified_gmt":"2024-05-31T19:00:16","slug":"font-size-adjust-from-front","status":"publish","type":"post","link":"https:\/\/philsinatra.net\/blog\/font-size-adjust-from-front\/","title":{"rendered":"Font size adjust, from-front"},"content":{"rendered":"\n<p>The <code>font-size-adjust<\/code> property in CSS is used to preserve the readability of the text when the fallback font is different from the primary font. Here&#8217;s an explanation of the <code>font-size-adjust<\/code> property from the given code:<\/p>\n\n\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\narticle {\n  font-family: &quot;Iowan Old Style&quot;, &quot;Palatino Lintype&quot;, serif;\n  font-size: 1.4rem;\n  font-size-adjust: from-font;\n}\ncode {\n  font-family: &quot;Courier New&quot;, monospace;\n}\n<\/pre>\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>font-size-adjust: from-font;<\/code><\/strong>: This property ensures that the x-height (the height of the lowercase &#8216;x&#8217; character) of the secondary fonts is maintained relative to the primary font. The value <code>from-font<\/code> means that the browser will automatically adjust the <code>font-size<\/code> of secondary fonts to match the x-height of the primary font family (<code>Iowan Old Style<\/code> in this case).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Purpose:<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Consistency in Height<\/strong>: Text remains visually consistent in height across different fonts, preventing drastic changes in text size when the primary font is unavailable.<\/li>\n\n\n\n<li><strong>Readability<\/strong>: Maintains legibility by adjusting the fallback fonts to have a similar perceived size to the primary font.<\/li>\n<\/ol>\n\n\n\n<p>Until the <code>from-font<\/code> value is supported, you can manually set the <code>font-size-adjust<\/code> value based on a calculation.<\/p>\n\n\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\narticle {\n  font-family: &quot;Iowan Old Style&quot;, &quot;Palatino Lintype&quot;, serif;\n  font-size: 1.4rem;\n  font-size-adjust: 0.47;\n}\ncode {\n  font-family: &quot;Courier New&quot;, monospace;\n}\n<\/pre>\n\n\n<p>In this example, <code>0.47<\/code> is a slight adjustment from the standard <code>0.5<\/code> value typically deferred from dividing the font&#8217;s <code>x-height<\/code> by the <code>font-size<\/code>. The value requires manual adjustment based on the fonts used in each scenario.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The font-size-adjust property in CSS is used to preserve the readability of the text when the fallback font is different from the primary font. Here&#8217;s an explanation of the font-size-adjust property from the given code: article { font-family: &quot;Iowan Old Style&quot;, &quot;Palatino Lintype&quot;, serif; font-size: 1.4rem; font-size-adjust: from-font; } code { font-family: &quot;Courier New&quot;, monospace; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[183],"tags":[192],"class_list":["post-1213","post","type-post","status-publish","format-standard","hentry","category-web-development","tag-css"],"_links":{"self":[{"href":"https:\/\/philsinatra.net\/blog\/wp-json\/wp\/v2\/posts\/1213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/philsinatra.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/philsinatra.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/philsinatra.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/philsinatra.net\/blog\/wp-json\/wp\/v2\/comments?post=1213"}],"version-history":[{"count":3,"href":"https:\/\/philsinatra.net\/blog\/wp-json\/wp\/v2\/posts\/1213\/revisions"}],"predecessor-version":[{"id":1217,"href":"https:\/\/philsinatra.net\/blog\/wp-json\/wp\/v2\/posts\/1213\/revisions\/1217"}],"wp:attachment":[{"href":"https:\/\/philsinatra.net\/blog\/wp-json\/wp\/v2\/media?parent=1213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/philsinatra.net\/blog\/wp-json\/wp\/v2\/categories?post=1213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/philsinatra.net\/blog\/wp-json\/wp\/v2\/tags?post=1213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}