title: Is it possible to use dynamic type sizes with a custom font in SwiftUI?
body: <p>I'm playing around with SwiftUI, and want to use a custom UI font for my project. However, I don't want to lose the dynamic type resizing that comes with the built-in font classes (e.g. Large Title).</p>
  
  <p>Apple does provide a custom font modifier for <code>Text</code>:</p>
  
  <pre class="lang-swift prettyprint-override"><code>Text("Hello, world!")
      .font(.custom("Papyrus", size: 17))
  </code></pre>
  
  <p>However, this fixes the size to 17pt. When you run this on a device or in the Simulator and open the Accessibility Inspector to adjust the OS-level font size, the <code>Text</code> element does not update.</p>
  
  <p>The <code>size:</code> parameter is not optional, so you must pass in something. And unfortunately, you can't get the <code>size</code> of an existing font (even a custom one), because <code>Font</code> does not have a <code>size</code> parameter.</p>
  
  <p>It seems to be a common pattern in the rest of SwiftUI that parameters can either be optional, or you can pass in <code>nil</code> to explicitly disable certain behavior. I would expect the <code>size:</code> parameter on <code>.custom()</code> to be optional, and internally either use the size from a previous <code>Font</code> modifier, or to use the default size set by <code>Text</code>.</p>
  
  <p>Alternately, the static methods that define system styles (e.g. <code>.largeTitle</code>) could accept an argument that provides a custom font name: <code>.largeTitle("Papyrus")</code></p>
  
  <p>Does anyone have a workaround?</p>