Convert from SwiftUI.Font to UIFont

A bit of a hack but works (doing the other direction is left as an exercise to the reader). extension UIFont { class func preferredFont(from font: Font) -> UIFont { let uiFont: UIFont switch font { case .largeTitle: uiFont = UIFont.preferredFont(forTextStyle: .largeTitle) case .title: uiFont = UIFont.preferredFont(forTextStyle: .title1) case .title2: uiFont = UIFont.preferredFont(forTextStyle: .title2) case … Read more

How can I use a custom font in Java?

If you include a font file (otf, ttf, etc.) in your package, you can use the font in your application via the method described here: Oracle Java SE 6: java.awt.Font There is a tutorial available from Oracle that shows this example: try { GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File(“A.ttf”))); } catch (IOException|FontFormatException e) { … Read more

Why would font names need quotes?

You can always put a specific font family name in quotes, double or single, so Arial, “Arial”, and ‘Arial’ are equivalent. Only the CSS-defined generic font family names like sans-serif must be written without quotes. Contrary to popular belief, a font name consisting of space-separated names such as Times New Roman need not be quoted. … Read more

Safari font rendering issues

There is a CSS property, text-rendering, which in Safari is by default set to optimizeSpeed. What you want to change is: text-rendering:optimizeLegibility; From https://css-tricks.com/almanac/properties/t/text-rendering/ There are four possible values: • auto (default) – The browser makes educated guesses about when to optimize for speed, legibility, and geometric precision while drawing text. Be aware that different browsers … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)