title: Can I close file descriptors for currently unused UIAppFonts?
body: <p>We bundle a lot of fonts with our iOS app, and we put them all in <code>UIAppFonts</code> for faster loading.<br>
  (We're using them inside <code>UIWebView</code> and it's <em>much</em> faster than using loading files with <code>@font-face</code>).</p>
  
  <p>However this lead me to occasionally get this kind of warning:</p>
  
  <pre><code>Mar 13 23:07:16 iPad afcd[2582] &lt;Error&gt;: Max open files: 78
  Mar 13 23:07:17 iPad mobile_house_arrest[2584] &lt;Error&gt;: Max open files: 78
  Mar 13 23:07:17 iPad mobile_house_arrest[2586] &lt;Error&gt;: Max open files: 78
  Mar 13 23:07:17 iPad mobile_house_arrest[2587] &lt;Error&gt;: Max open files: 78
  Mar 13 23:07:17 iPad mobile_house_arrest[2588] &lt;Error&gt;: Max open files: 78
  </code></pre>
  
  <p>This also correlated with I/O exceptions when opening files.   </p>
  
  <p>I used <a href="https://stackoverflow.com/a/8153026/458193">this snippet</a> to find out the leaking files and it looks like iOS  <strong>keeps open file descriptors for every font listed in <code>UIAppFonts</code> throughout the whole lifetime of the application</strong>.</p>
  
  <pre><code>File Descriptor 8 number 9 in use for: Fonts/ABeeZee-Regular.ttf
  File Descriptor 9 number 10 in use for: Fonts/ABeeZee-Regular.ttf
  File Descriptor 10 number 11 in use for: Fonts/ABeeZee-Italic.ttf
  File Descriptor 11 number 12 in use for: Fonts/ABeeZee-Italic.ttf
  File Descriptor 12 number 13 in use for: Fonts/AmaticSC-Regular.ttf
  File Descriptor 13 number 14 in use for: Fonts/AmaticSC-Regular.ttf
  File Descriptor 14 number 15 in use for: Fonts/AmaticSC-Bold.ttf
  File Descriptor 15 number 16 in use for: Fonts/AmaticSC-Bold.ttf
  File Descriptor 16 number 17 in use for: Fonts/AnonymousPro-Bold.ttf
  File Descriptor 17 number 18 in use for: Fonts/AnonymousPro-Bold.ttf
  File Descriptor 18 number 19 in use for: Fonts/AnonymousPro-Regular.ttf
  File Descriptor 19 number 20 in use for: Fonts/AnonymousPro-Regular.ttf
  </code></pre>
  
  <p>For us, it means about a hundred open file descriptors, although not more than five of <code>UIAppFonts</code> are being used at the moment. Sometimes, duplicate entries show up.</p>
  
  <p><strong>Is there anyway to forcibly close file descriptors for <code>UIAppFonts</code> I'm not using at the moment?</strong></p>
  
  <p>If not, is there an alternative way of keeping local fonts available to <code>UIWebView</code> without resorting to <code>@font-face</code> which is slow?</p>