nutritionfactsorg / daily-dozen-ios

Keep track of the foods that Dr. Greger recommends in his NYT's best-selling book, How Not to Die with this iOS app
https://apps.apple.com/us/app/dr-gregers-daily-dozen/id1060700802
Other
149 stars 39 forks source link

Fonts #72

Open marc-medley opened 9 months ago

marc-medley commented 9 months ago

Font issues for Cyrillic translations surfaced during the release candidate testing of v3.4.13 (which was ultimately released as v3.4.15).

Bulgarian_Video

The root cause was found to be the use of the much older Helvetica instead of Helvetica Neue in some cases.

The observed issues were resolved with an update to Fonts.swift.

private struct Strings {
    static let courier = "Courier"
    static let helveticaBold = "Helvetica-Bold"
    static let helveticaNeueMedium = "HelveticaNeue-Medium"
    static let helvetica = "Helvetica"
}

During the transtion to SwiftUI the following needs to occur:

  1. Update all "system fonts" use to the current system font type which is San Francisco
  2. Review the use of Courier
  3. Consolidate all the font references to into the application fonts manager. There are still many font references scattered across the storyboards.
  4. Upgrade the static var fontfamilyBold17: UIFont approach.
marc-medley commented 9 months ago

A candidate upgrade aproach could be based on something like the code below. However, with San Francisco.

public enum helveticaNeue: String {

    case neue = "HelveticaNeue"
    case bold = "HelveticaNeue-Bold"
    case boldItalic = "HelveticaNeue-BoldItalic"
    case condensedBlack = "HelveticaNeue-CondensedBlack"
    case condensedBold = "HelveticaNeue-CondensedBold"
    case italic = "HelveticaNeue-Italic"
    case light = "HelveticaNeue-Light"
    case lightItalic = "HelveticaNeue-LightItalic"
    case medium = "HelveticaNeue-Medium"
    case mediumItalic = "HelveticaNeue-MediumItalic"
    case ultraLight = "HelveticaNeue-UltraLight"
    case ultraLightItalic = "HelveticaNeue-UltraLightItalic"
    case thin = "HelveticaNeue-Thin"
    case thinItalic = "HelveticaNeue-ThinItalic"

    public func font(size: CGFloat) -> UIFont {
        return UIFont(name: self.rawValue, size: size)!
    }
}
jamie-brannan commented 8 months ago

Hi @marc-medley I'd like to take this ticket if possible πŸ˜‡ πŸ™

jamie-brannan commented 8 months ago

I've been preparing a branch but unfortunately I keep getting blocked by the GoogleService-Info.plist that's missing from the project with my fresh clone? πŸ€”

Screenshot 2024-01-05 at 11 55 28 AM

I don't know if that's intentional or hope it's not a noob open-source project security question, but I see elsewhere it's supposed to be in the project.

i was worried it had to do with my pod install but I just can't find it anywhere to get up and running.

krugerk commented 8 months ago

I an wondering if, as a workaround, one could create such a file (possibly even empty) locally in the project.

The real file would contain secrets not meant for a public repository.

krugerk commented 8 months ago

I've been preparing a branch but unfortunately I keep getting blocked by the GoogleService-Info.plist that's missing from the project with my fresh clone? πŸ€”

Screenshot 2024-01-05 at 11 55 28 AM

I don't know if that's intentional or hope it's not a noob open-source project security question, but I see elsewhere it's supposed to be in the project.

i was worried it had to do with my pod install but I just can't find it anywhere to get up and running.

https://github.com/nutritionfactsorg/daily-dozen-ios/issues/73#issuecomment-1874468962 mentions a workaround: wrapping the inclusion of the plist file in ifdef and removing the file from the xcode project, locally.

marc-medley commented 8 months ago

I'd like to take this ticket if possible πŸ˜‡ πŸ™

Perhaps yes…

I had created this ticket as a reminder for myself for a future phase of development.

The uniform use of HelveticaNeue resolved the Cyrillic inconsitancy issues for the current releases, so this ticket is currently a non-urgent enhancement.

That said, once v3.5.1 is in the Apple App Store review process I will create a develop-fonts branch based on v3.5.1 and then return to review what would be the hand-off scope with you.

jamie-brannan commented 8 months ago

Hmmm I cannot seem to reproduce the issue today πŸ€”

Simulator Screenshot - iPad (10th generation) - 2024-01-08 at 18 20 23

Is this still an issue you reproduce on your ends @krugerk and @marc-medley?