Me gustaría mostrar una fuente personalizada dentro de UIWebView. Ya coloqué la fuente en el plist debajo de "Fuentes provistas por la aplicación". El código en uso:Uso de fuente personalizada en UIWebView
UIWebView *webView = [[UIWebView alloc] initWithFrame:myRect];
NSURL *baseURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
[webView loadHTMLString:html baseURL:baseURL];
[self addSubview:webView];
donde html es un NSString que tiene el siguiente contenido:
<html><head>
<style type="text/css">
@font-face {
font-family: gotham_symbol;
src: local('GOTHAMboldSymbol_0.tff'), format('truetype')
}
body {
font-family: gotham_symbol;
font-size: 50pt;
}
</style>
</head><body leftmargin="0" topmargin="0">
This is <i>italic</i> and this is <b>bold</b> and this is some unicode: э
</body></html>
estoy usando iOS 4.2 con el fin de TTF debe ser apoyada. Apreciaría un poco de html/code que realmente funciona.
'GOTHAMboldSymbol_0.tff' - extensión debe ser' ttf' (a menos que la fuente realmente tenga una extensión 'tff' en el disco). –
Estoy tratando de encontrar una solución a esto también, pero: creo que quiere pasar 'nil' para baseURL. – MusiGenesis
@Joris Lucho con el mismo problema en este momento y sería interesante escuchar si ha encontrado una solución. – Lindemann