Skip to content

Instantly share code, notes, and snippets.

Type 1 fonts (also called PostScript fonts) often appear with different names in Mac OS font menus than they do in Windows font menus. While each Type 1 font has a unique PostScript name that is identical in Mac OS and in Windows, the same Type 1 font appears with a different name in font menus in Mac OS, in font menus in Windows, and in Adobe Type Manager (ATM) for Windows. These name differences can lead to a perception that fonts are missing in Windows, and can cause fonts to be substituted with other fonts when you transfer files across platforms.Although fonts may have different names on different platforms, once you understand font name style links, you can use them to access your fonts on both platforms and avoid font matching problems
via [here](https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5090.FontNameList.pdf)
@shengyang998
shengyang998 / modifyTraits enable
Last active March 1, 2019 07:27
Chinese font oblique type
```swift
func modifyTraits(_ traits: UIFontDescriptorSymbolicTraits, enable: Bool) -> UIFont {
// FIXME: - Chinese oblique type
if newTraits.contains(.traitItalic) && familyDescriptor.postscriptName.hasPrefix(".PingFangSC") {
let _c = tanf(Float(15.0 * CGFloat.pi / 180.0))
let matrix = CGAffineTransform(a: 1, b: 0, c: CGFloat(_c), d: 1, tx: 0, ty: 0)
let chineseItalicDescriptor = UIFontDescriptor(name: "", matrix: matrix)
return UIFont(descriptor: chineseItalicDescriptor, size: pointSize)
@shengyang998
shengyang998 / canConvertToURL
Last active March 1, 2019 07:27
Swift String Extension: Can convert to url
```swift
extension String {
/// - Returns a Bool to determine if a string can be converted to a valid url
func canConvertToURL() -> Bool {
if let url = URL(string: self) {
return UIApplication.shared.canOpenURL(url)
} else { return false }
}
@shengyang998
shengyang998 / hs.md
Created February 2, 2017 14:40 — forked from jackywyz/hs.md
Haskell总结

###haskell 基本类型,bool(True/False),list[],tuple(),int,Integer,Double,char'' ,string"",function(\x->x+1)

  1. wiki