I need UTF8-capable reports, and I need to be able to run on CentOS, Windows, and Mac. This is particularly tricky, as the set of shared UTF-8 fonts seems to be non-existent.
In iReport, you can set a single font via a drop-down box, and there doesn't seem to be a way to specify multiple fonts. Is there any way I can use a list of arial fonts to try for a given field? Or is there a better way to support running on multiple platforms?
Normally the correct answer to cross-platform font problems is "use font extensions", and Stefan's link provides the solution.
In your case the requirement for "CentOS, Windows, and Mac" is really a bit of a red herring. Your real requirement seems to be "a free True Type Font that covers all of the characters you will use". If you had that, you could use use font extensions on any platform and life would be perfect.
MS Arial Unicode would probably meet the requirement... except that it's not free.
There's really only one Arial font. It's owned by Monotype Imaging. There are subsets and families and styles... but they are all part of the one Arial. So I don't think the phrase "a list of arial fonts" is strictly meaningful.
But you would probably be happy with a set of N fonts that are all sufficiently similar to Arial for your needs, and between them they cover all of the characters you need. Maybe start with Liberation Fonts, throw in UMing, a little of this, a little of that... Assuming you can find all the fonts you need... you're still stuck. Sorry. You need this feature enhancement to have a way to tell JasperReports to link different physical fonts to one logical font defined as a font extension. It actually came up in a different context (as indicated in the request), but I think it would perfectly meet your needs. Please vote it up.
Until that's available, sites like unifont have quite a few fonts available. Maybe one is good enough for your needs.
JasperReports Font Documentation
- This document describes how to package fonts so you can use the same font on multiple platforms.
Related
Not sure if SO is the best place for this question, but don't know where else to ask.
Is there any way to transform a svg like this one for ex: (https://svgsilh.com/image/1775543.html) into something that i can use inside an editor with copy/paste like this one? 🦄
No, because the unicorn emoticon is one example of a character. And just as with letters, digits, and punctuation, the appearance of emoticons and other plain-text symbols is decided by fonts.
LSerni wrote the following:
The reason you can "copy and paste" that icon is that the icon already has a UTF-8 code and your editor is UTF-8 aware. And this is why the same emoticon is slightly different between Apple, Android and so on: it's because it's always code XYZ, but code XYZ is rendered with different icons on different platforms.
But that's not entirely correct. The difference in rendering lies more in the font than in the operating system that displays emoticons. Unless the font supplies its own version of a symbol, that symbol will usually be supplied by the font specified by default by the operating system, and different operating systems supply different symbol fonts.
I wrote a script which parses information from PDF files and outputs it to HTML. It's written in Python, using pdfminer.
On some text segments, the font style can have semantic significance. For instance: bold, italic and color should trigger different behavior. Pdfminer provides scripts with the font name, but not the color, and it has a number of other issues; so I'm working on a Swift version of that program, using Apple's PDFKit, to extract the same features.
I now find that I have the opposite problem. While PDFKit makes it easy to retrieve color, retrieving the original font name seems to be non-obvious. PDFSelection objects have an attributedString property, but for fonts that are not installed on my computer, the NSFont object is Helvetica. Of course, the fonts in question are fairly expensive, and acquiring a copy just for this purpose would be poor form.
Short of dropping to CGPDFContentStream (which is way too big of a hammer for what I want to get), is there a way of getting the original font name? I know in advance what the fonts are going to be, can I use that to my advantage?
PDFKit seems to use the standard font lookup system and then falls back on some default, so this can be resolved by spoofing the font to ensure that PDFKit doesn't need to fall back. Inspecting the document, I was able to identify that it uses the following fonts (referenced with their PostScript name):
"NeoSansIntel"
"NeoSansIntelMedium"
"NeoSansIntel,Italic"
I used a free font creation utility to create dummy fonts with these PostScript names, and I added them to my app bundle. I then used CTFontManagerRegisterFontsForURLs to load these fonts (in the .process scope), and now PDFKit uses these fonts for attributed strings that need them.
Of course, the fonts are bogus and this is useless for rendering. However, it works perfectly for the purpose of identifying text that uses these font.
In Windows we can collect information about scripts supported by Font Family.
i.e.
Family Name : AdobeArabic-Regular
Script : Western
Script : Arabic
Script : Mac
How to know same thing in Mac ?
To get Styles (Bold, Bold Italic etc... ) We can use NSFontManager support.
NSArray* familyFonts = [[NSFontManager sharedFontManager] availableMembersOfFontFamily: "AdobeArabic-Regular"];
But not getting any info about Scripts..
Any solutions ?
I don’t know if this helps as it may not be the easiest way, but I hope this gets you in the right direction:
The thing you’re looking for is/are the OpenType layout tags (sometimes also called "feature tags") where a subset of these tags also defines supported scripts. These are four-character codes, like "arab" for arabic script (extended list see below). As the NSFontManager afaik doesn’t support reading these tags, I would have a look at CoreText’s CTFont framework, which provides in-depth capability of reading font properties. There I would have a look at CTFontCopyFeatures or perhaps CTFontCopyAvailableTables and CTFontCopyAttribute. I haven’t tested, but hope one of them is also capable of reading the layout/features tags.
Here you can find a list of OpenType layout tags, TrueType layout tags and the CoreText Reference.
CTFontDescriptorCopyAttribute(ctFontDescriptor, kCTFontLanguageAttribute) would be the closest one, but sadly that is about language but not script...
This could probably also be asked as "Is kCTKernAttributeName a misnomer?"
I need to change the letter spacing/tracking of some text in iOS. (The font I'm using is a little too tight at small sizes.) There are core graphics routines that will change character spacing, but those routines don't handle Unicode. There are other core graphics routines that are defined in terms of glyphs but those seem like a world of hurt, among other things, not having the safety net of reverting back to system fonts for glyphs that don't exist in my font.
So core text seems like the way to do this and core text supports kCTKernAttributeName on CFAttributedString. I think this will do what I want, though this really isn't kerning since kerning is a generally a character-pair attribute and this (appears to be, from the docs) just a uniform adjustment to the glyph advance for all glyphs, i.e., tracking.
If anyone knows before I go down the rather painful path of converting to the core text API ...
kCTKernAttribute name should do what you want. Setting it over a range of text adjusts the inter-glyph spacing consistently, irrespective of the specific glyphs.
I think part of the problem is that kerning seems to have been a virtual synonym of tracking (it's still just "adjust the spacing between (letters or characters) in a piece of text to be printed" in the dictionary that comes with OS X), and is now adopting just the meaning of pair kerning because of the redundancy. Probably an etymologist would be better placed to comment on that side of things...
I'm building an interface with a lot of info on the screen.. dozens of inputs, with accompanying labels. as a result of the volume of info the fonts have necessarily become pretty small.
but I'd like this to be as readable and usable as possible.. is there a really nice font that's both readable and compact, that works well in a browser (specifically in this case, IE7) ?
anyone have any other tips to sort this out? is there some specific combination of pixel/em size and font, or some other CSS voodoo that can help me out?
this is an intranet app so we actually can be pretty specific.
any suggestions appreciated, thanks.
To have it resized cross browser, use ems. Set your font-size on body element to be 62.5% to make sizing ems clearer. 1.2em = 12px.
Arial is pretty good font. So is Helvetica.
Do you keep accessibility in mind? Isn't it possible to redesign the interface so that less information is shown and people with less than 20/20 vision can easily read your pages?
Typically, sans serif fonts are more readable when used with small sizes. If you want to use a monospaced font, I personally quite like Vista's 'consolas' font.
According to this post from 2006:
http://www.kathymarks.com/archives/2006/11/best_fonts_for_the_web_1.html
Tahoma could be winner:
"Tahoma (Windows). Tahoma was designed especially for legibility on the screen. It's preloaded on Windows systems. Similar in style to Verdana, it is narrower and more condensed"