title: How to set font family to edit-text with data-binding layout in Android
body: <p>I Create a data model for my activity like this:</p>
  <pre><code>data class ActivityModel (
      var font: Int
  )
  </code></pre>
  <p>And set the value to this <strong>font</strong> in the activity as this way:</p>
  <pre><code>items.font = R.font.san_francisco
  </code></pre>
  <p>And finally, use it in XML layout like this:</p>
  <pre><code>android:fontFamily=&quot;@{ResourcesCompat.getFont(context, items.font)}&quot;
  </code></pre>
  <p>also I import this varriables to XML layout:</p>
  <pre><code>    &lt;import type=&quot;androidx.core.content.ContextCompat&quot;/&gt;
      &lt;import type=&quot;androidx.core.content.res.ResourcesCompat&quot;/&gt;
  </code></pre>
  <p>But in this way, the app doesn't be building and I have errors from <strong>java (generated)</strong> directory.</p>
  <p>So, How can I set the font family to edit-text?</p>