1616using System . Collections . Generic ;
1717using CoreFoundation ;
1818using System . Diagnostics ;
19+ using CoreText ;
1920
2021namespace GMImagePicker
2122{
@@ -121,7 +122,7 @@ public override void ViewDidLoad()
121122 // Buttons
122123 var barButtonItemAttributes = new UITextAttributes
123124 {
124- Font = UIFont . FromName ( _picker . PickerFontName , _picker . PickerFontHeaderSize )
125+ Font = FontParser . GetFont ( _picker . PickerFontName , _picker . PickerFontHeaderSize )
125126 } ;
126127
127128 var cancelTitle = _picker . CustomCancelButtonTitle ?? "picker.navigation.cancel-button" . Translate ( defaultValue : "Cancel" ) ;
@@ -324,7 +325,7 @@ public override UITableViewCell GetCell(UITableView tableView, NSIndexPath index
324325 cell . Tag = currentTag ;
325326
326327 // Set the label
327- cell . TextLabel . Font = UIFont . FromName ( _picker . PickerFontName , _picker . PickerFontHeaderSize ) ;
328+ cell . TextLabel . Font = FontParser . GetFont ( _picker . PickerFontName , _picker . PickerFontHeaderSize ) ;
328329 cell . TextLabel . Text = _collectionsFetchResultsTitles [ indexPath . Section ] [ indexPath . Row ] ;
329330 cell . TextLabel . TextColor = _picker . PickerTextColor ;
330331
@@ -334,7 +335,7 @@ public override UITableViewCell GetCell(UITableView tableView, NSIndexPath index
334335 // Display the number of assets
335336 if ( _picker . DisplayAlbumsNumberOfAssets )
336337 {
337- cell . DetailTextLabel . Font = UIFont . FromName ( _picker . PickerFontName , _picker . PickerFontNormalSize ) ;
338+ cell . DetailTextLabel . Font = FontParser . GetFont ( _picker . PickerFontName , _picker . PickerFontNormalSize ) ;
338339 // Just use the number of assets. Album app does this:
339340 cell . DetailTextLabel . Text = string . Format ( "{0:0}" , assetsFetchResult . Count ) ;
340341 cell . DetailTextLabel . TextColor = _picker . PickerTextColor ;
@@ -456,7 +457,7 @@ public override void WillDisplayHeaderView(UITableView tableView, UIView headerV
456457 header . BackgroundView . BackgroundColor = _picker . PickerBackgroundColor ;
457458
458459 // Default is a bold font, but keep this styled as a normal font
459- header . TextLabel . Font = UIFont . FromName ( _picker . PickerFontName , _picker . PickerFontNormalSize ) ;
460+ header . TextLabel . Font = FontParser . GetFont ( _picker . PickerFontName , _picker . PickerFontNormalSize ) ;
460461 header . TextLabel . TextColor = _picker . PickerTextColor ;
461462 }
462463
0 commit comments