Вы можете сказать value.asInstanceOf[FontUIResource]
, или вы можете использовать блок совпадений:
value match{
case f:FontUIResource =>
//do something with f, which is safely cast as a FontUIResource
case _ =>
//handle the case when it's not the desired type
}