{"id":8090,"date":"2020-04-04T18:57:41","date_gmt":"2020-04-04T18:57:41","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=8090"},"modified":"2020-04-04T18:57:41","modified_gmt":"2020-04-04T18:57:41","slug":"custom-fonts-in-xamarin-forms-v4-5-0-530","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/custom-fonts-in-xamarin-forms-v4-5-0-530\/","title":{"rendered":"Custom Fonts in Xamarin Forms v4.5.0.530"},"content":{"rendered":"<p>In my previous post <a href=\"http:\/\/putridparrot.com\/blog\/custom-fonts-in-xamarin-forms\/\" rel=\"noopener noreferrer\" target=\"_blank\">Custom Fonts in Xamarin Forms<\/a> the section title <strong>Preview Feature<\/strong> is now working.<\/p>\n<p><em>We&#8217;re use the Lobster-Regular.ttf file mentioned in the aforementioned post.<\/em><\/p>\n<ul>\n<li>Add a Resources\/Fonts folder to your shared project<\/li>\n<li>Add your .otf or .ttf file to this Fonts folder<\/li>\n<li>Set the Build Action to <strong>Embedded resource<\/strong><\/li>\n<li>In you AssemblyInfo.cs file add\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n&#x5B;assembly: ExportFont(&quot;Lobster-Regular.ttf&quot;)]\r\n<\/pre>\n<\/li>\n<li>Now in your XAML you simply use\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n&lt;Label Text=&quot;Hello Xamarin.Forms&quot;\r\n   FontFamily=&quot;Lobster-Regular&quot; \/&gt;\r\n<\/pre>\n<\/li>\n<\/ul>\n<p>That&#8217;s all there is to it. <\/p>\n<p>You may still want to use the previous method for custom fonts if applying either different fonts to different devices, otherwise, this is such a simple and natural way to handle this task.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my previous post Custom Fonts in Xamarin Forms the section title Preview Feature is now working. We&#8217;re use the Lobster-Regular.ttf file mentioned in the aforementioned post. Add a Resources\/Fonts folder to your shared project Add your .otf or .ttf file to this Fonts folder Set the Build Action to Embedded resource In you AssemblyInfo.cs [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[289,122],"tags":[],"class_list":["post-8090","post","type-post","status-publish","format-standard","hentry","category-fonts","category-xamarin-forms"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/8090","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=8090"}],"version-history":[{"count":2,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/8090\/revisions"}],"predecessor-version":[{"id":8092,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/8090\/revisions\/8092"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=8090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=8090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=8090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}