{"action":"created","issue":{"url":"https://api.github.com/repos/evermeer/AttributedTextView/issues/15","repository_url":"https://api.github.com/repos/evermeer/AttributedTextView","labels_url":"https://api.github.com/repos/evermeer/AttributedTextView/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/evermeer/AttributedTextView/issues/15/comments","events_url":"https://api.github.com/repos/evermeer/AttributedTextView/issues/15/events","html_url":"https://github.com/evermeer/AttributedTextView/issues/15","id":299383174,"number":15,"title":"More fonts in one AttributedTextView","user":{"login":"vojtaBelovsky","id":3873468,"avatar_url":"https://avatars3.githubusercontent.com/u/3873468?v=4","gravatar_id":"","url":"https://api.github.com/users/vojtaBelovsky","html_url":"https://github.com/vojtaBelovsky","followers_url":"https://api.github.com/users/vojtaBelovsky/followers","following_url":"https://api.github.com/users/vojtaBelovsky/following{/other_user}","gists_url":"https://api.github.com/users/vojtaBelovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/vojtaBelovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vojtaBelovsky/subscriptions","organizations_url":"https://api.github.com/users/vojtaBelovsky/orgs","repos_url":"https://api.github.com/users/vojtaBelovsky/repos","events_url":"https://api.github.com/users/vojtaBelovsky/events{/privacy}","received_events_url":"https://api.github.com/users/vojtaBelovsky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-22T14:53:28Z","updated_at":"2018-02-22T17:16:03Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI need to have more fonts in one AttributedTextView instance. For example:\r\n\r\nUser1 followed (\"myFontRegular\") User2(\"myFontBold\")\r\n\r\nI tried it to implement in many ways, but I found out that only first font is applied to whole text in AttributedTextView. Here is sample of my implementation:\r\n\r\n            statusLabel.attributer =\r\n                name.color(.charcoal).font(.graphik(15))\r\n                .append(\" followed \").color(.aluminium).font(.graphik(15))\r\n                .append(\"\\(post.follow_display_name ?? \"some user\")\").makeInteract({ _ in\r\n                    if let followId = post.follow_user_id {\r\n                        self.callback?(.user, followId)\r\n                    }\r\n                })\r\n                .setLinkColor(.darkGreen).font(.graphikBold(15))\r\n\r\nBut result of this implementation is that whole text is in graphik font, not graphik and graphikBold. I tried to change sizes, and these are applied correctly, but different fons not. Is it somehow possible to achieve what I need by using AttributedTextView?\r\n\r\nThanks,\r\n\r\nVojta"},"comment":{"url":"https://api.github.com/repos/evermeer/AttributedTextView/issues/comments/367753069","html_url":"https://github.com/evermeer/AttributedTextView/issues/15#issuecomment-367753069","issue_url":"https://api.github.com/repos/evermeer/AttributedTextView/issues/15","id":367753069,"user":{"login":"evermeer","id":130834,"avatar_url":"https://avatars1.githubusercontent.com/u/130834?v=4","gravatar_id":"","url":"https://api.github.com/users/evermeer","html_url":"https://github.com/evermeer","followers_url":"https://api.github.com/users/evermeer/followers","following_url":"https://api.github.com/users/evermeer/following{/other_user}","gists_url":"https://api.github.com/users/evermeer/gists{/gist_id}","starred_url":"https://api.github.com/users/evermeer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evermeer/subscriptions","organizations_url":"https://api.github.com/users/evermeer/orgs","repos_url":"https://api.github.com/users/evermeer/repos","events_url":"https://api.github.com/users/evermeer/events{/privacy}","received_events_url":"https://api.github.com/users/evermeer/received_events","type":"User","site_admin":false},"created_at":"2018-02-22T17:16:03Z","updated_at":"2018-02-22T17:16:03Z","author_association":"OWNER","body":"I'm not sure what's going on here. You do have to be aware that a label (statusLabel?) can not use makeInteract. You need a textview for that. \r\n\r\nThe setLinkColor will set the link color property on the textView. You can only set it for the entire textview. You cannot have diverent colors.\r\n\r\nI assume your .graphik .charcoal .aluminium an .graphikBold are valid UIColor and UIFont implementations.\r\n\r\nI just did a test with some of the default fonts an this works:\r\n```\r\ntextView1.attributer = \"Edwin\".red.fontName(\"Baskerville\").size(15)\r\n    .append(\"Edwin\").gray.font(UIFont(name: \"SourceSansPro-Regular\", size: 15))\r\n    .append(\"Edwin\").makeInteract({ _ in\r\n    }).fontName(\"Helvetica\").size(18)\r\n    .setLinkColor(.orange)\r\nattributedText = textView1.attributedText // View the details for this -->\r\n\r\n```\r\n\r\n"}}
{"actor":{"display_login":"evermeer"}}