Font resolution changes on resize - glyph

I have bought online the Hackney font. This is great font, but depending on the size of the displayed area, or the size of the font, this latter suddenly changes its resolution. Here is a comparison between font resolutions
I don't know how to fix this, I would like at least to lower the limit and show high resolution, but is it even possible ?
Any idea how to fix this ?

Related

Actual display size of IOS fonts doesn't match metrics

I am writing an iPad app which requires letters to be displayed at their exact point size regardless of screen size.
I've implemented the text display using a UILabel object. I have the Autoshrink property set to Fixed Font Size, however the letters on the screen are much smaller than indicated by the font metrics. For instance the capitals of a 251 point font, which should be 3.5 inches tall, are only 2 inches on the screen. At different point sizes the same shrinkage happens.
The fontCapHeight is the same as the font size with the font I am using.
How can I make the displayed size is the same as the font size?
For instance the capitals of a 251 point font, which should be 3.5 inches tall, are only 2 inches on the screen.
You're assuming a point is 1/72", which is not true. That's a desktop publishing point. A point in iOS is a certain number of pixels (based on the scale). The number of pixels in an inch are a factor of the screen's pixel density (PPI). iOS provides no way to query for that that I'm aware of. You have to just have a big table that knows. A fairly nice one for that is GBDeviceInfo, but ultimately it just has a big table of values based on looking up specs or measuring screens.
You need your cap height (pt) to be (ppi/scale)*inches, but you can't set cap height directly. You need to set it via the em box size (the "font size"). Here's an example. It takes a label containing a font of any size and make it's cap height be 3".
let font = label.font!
let ppi = 326.0 // iPhone 6s
let scale = Double(UIScreen.main.scale)
let desiredSize = 3.0 // inches
let emBoxRatio = Double(font.pointSize / font.capHeight)
let fontSize = (ppi / scale) * desiredSize * emBoxRatio
label.font = label.font.withSize(CGFloat(fontSize))
Keep in mind that "make its cap height be 3 inches" is not the same thing as "make any particular letter be 3 inches." It depends on the font and the letter. In many fonts, glyphs with a curved top are a little taller than the cap height, and some ascenders may be a little taller than the cap height. While H, X, and I are often exactly the cap height, sometimes they're a little shorter (sometimes O is the cap height rather than X). Sometimes glyphs are above their baseline. There is nothing that says that a font even has to fit within its em box, and some fonts draw wildly outside (Zapfino, I'm looking at you).
My only point here is that you need to check your actual font carefully. Font metrics are serving suggestions at best. They're meant to make fonts with similar metrics "feel" the same. They're not always absolute measures of things.
I don't understand this:
The fontCapHeight is the same as the font size with the font I am using
If the cap height is the same as the "font size" (em box height), then where are the descenders? It feels like you've run out of em box.
Problem solved. I found the following statement at http://blog.fluidui.com/designing-for-mobile-101-pixels-points-and-resolutions/ : "An iOS point is equivalent to 1/163 of an inch. This size is always the same regardless of the resolution of the phone it is on, and comes from the 163DPI of the original iPhone." I couldn't find it anywhere in the Apple documentation, but I'm sure it is there somewhere!

Understanding default font sizes in React Native

I've been working on a React Native app for the past few months, and something has always eluded me that I'm just now trying to get to the bottom of. I'm trying to standardize the font sizes within my app (for body, headers, etc.) and am struggling to understand where exactly React Native gets its default font size from. I've been testing in an iPhone 8 simulator running iOS 11, and through experimentation have come to the conclusion the default font displayed is 14 logical pixels (as in a brand-new element with no styling). However, checking the iOS style guidelines it would seem the default body text on iOS is intended to be 17pt. Although I don't a ton about device scaling, I've tried crunching the numbers in every online converter I could find, and could not come up with how 17pt may come close to 14 logical pixels (assuming RN uses the body font size by default). The only way I was able to roughly translate the two was if the DPI was around 90, but the DPI for iPhones is much, much higher. So might anyone be able to offer insight as to how default fonts are selected in React Native? Even hunting through the source code I couldn't find much. I'd like to be able to calculate the base size myself so I can scale the other font sizes according. Thanks in advance!
I suggest you to look at react-native-element's helper method normalizeText. It calculates the pixel ratio and set the texts fontSize accordingly.
Also you should also take in consideration of Accessibility Text Size Option in iOS. This option will be affecting all your app.

Setting text size according to overall width of superview

Its not really a programming question but a design implementation question but anyway im wondering how you choose the text sizes in general according to the screen size. So an example is like before there was auto layout i used to say I want this views width to always be 30% of the superviews width. So no matter on what screen, be it iPhone or iPad, the width of the view will always be 30% of its superview. Now im wondering how would you choose the text size. Whats the rule of thumb for choosing the text size of a UILabel if its going to not look good on an iPhone but will look good on an iPad. What i would really want from everyone is for us to talk about rules of thumbs we use specifically when hitting my current situation. What do you do?
Ok, first of all you should
read the HIG:
Now to add some value with interpretation, there's not inherently a different between iPad and iPhone. IF it's legible on device it should be more or less legible on another, unless you're on the cusp of being legible on the lowest DPI device - a poor decision in any case.
I cannot stress enough you should support and query the system accessibility fonts. I.e. people hard of reading will choose bigger fonts sizes, all of Apple's software and system supports it.
Usually in the iPad, you add more content/spaces but offer the same sizes. Buttons, as a rule can be bit bigger. That will define what looks good, widen margins on the iPad a bit, which I believe is already done.

Photoshop Font Pixel Size to Xcode Interface builder Font Point Size

How do I match the font pixel size given to me by my designer in PhotoShop to the correct font size in Xcode Interface builder.
For example, my designer is using Helvetica Neueu Regular 32px Font in his design.
I've used a few points to pixel translation sites, but it doesn't seem exact.
I have attempted to follow the answer from this question, but to no avail:
https://stackoverflow.com/a/6107836/1014164
You will never have perfect results when visually comparing a Photoshop comp to a real program. In fact, it's not un-common for a text layout to be different between different computers because version and operating system differences (as well as monitor layouts) cause the text to reflow every time it's edited.
Unless things are very much different in other versions of Photoshop, your designer hasn't specified 32px because Photoshop doesn't lay text out in pixels - it works in points/picas. The exact text rendering is also dependent on the document's resolution (which is different between print and screen).
The best you can do is get the text to look roughly proportional to the designer's intent. In modern iOS, most apps will use the user's customized font settings anyway.

What size image should I use for BlackBerry context menus?

The BB OS 5.0 supports images for context menus. The API documentation says the image will be scaled to fit a square set by the height of the menu font. I find that totally unhelpful.
The only way I can explain that method of calculation is due to screen resolution and DPI. But since the 5.0 OS is only valid on a handful of devices with similar screen sizes, I reckon they can specify the actual icon size they use.
I'd like to choose an icon size that's closest to the default menu font height so that the they look OK.
What size do you use? Do you even use this feature?
I haven't used it yet, but I would recommend using any square ratio maybe up to 64x64; the problem is that with new devices on the horizon (eg rumored tablet - with much bigger display) it won't necessarily be practical to target a specific screen size.

Resources