{"action":"created","issue":{"url":"https://api.github.com/repos/empira/PDFsharp/issues/72","repository_url":"https://api.github.com/repos/empira/PDFsharp","labels_url":"https://api.github.com/repos/empira/PDFsharp/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/empira/PDFsharp/issues/72/comments","events_url":"https://api.github.com/repos/empira/PDFsharp/issues/72/events","html_url":"https://github.com/empira/PDFsharp/issues/72","id":372294689,"node_id":"MDU6SXNzdWUzNzIyOTQ2ODk=","number":72,"title":"[Feature request] Support for changing FontResolver","user":{"login":"LokiMidgard","id":389101,"node_id":"MDQ6VXNlcjM4OTEwMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/389101?v=4","gravatar_id":"","url":"https://api.github.com/users/LokiMidgard","html_url":"https://github.com/LokiMidgard","followers_url":"https://api.github.com/users/LokiMidgard/followers","following_url":"https://api.github.com/users/LokiMidgard/following{/other_user}","gists_url":"https://api.github.com/users/LokiMidgard/gists{/gist_id}","starred_url":"https://api.github.com/users/LokiMidgard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LokiMidgard/subscriptions","organizations_url":"https://api.github.com/users/LokiMidgard/orgs","repos_url":"https://api.github.com/users/LokiMidgard/repos","events_url":"https://api.github.com/users/LokiMidgard/events{/privacy}","received_events_url":"https://api.github.com/users/LokiMidgard/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-21T09:13:07Z","updated_at":"2018-10-21T09:36:14Z","closed_at":"2018-10-21T09:36:14Z","author_association":"NONE","body":"If you once set `GlobalFontSettings.FontResolver` you can't change it.\r\n\r\nI have a Project that gets inputs from different sources which can bring there own fonts.\r\nBecause the different sources can use the same name for different fonts, the easiest way would be create a font resolver for any input and than switching the `GlobalFontSettings.FontResolver`. The library would then automatically invalidate all caches.\r\n\r\nI currently see only two work arounds:\r\n1. Create an lookup for any font to an unique generated font name, so no font from any source will have the same name internally.\r\n2. Create a new AppDomain and tear it down.\r\n\r\nUnfortunately I can't use 2 and using one will eventually run out of memory, because the internal cache will only grow and never shrinks until the process is terminated. "},"comment":{"url":"https://api.github.com/repos/empira/PDFsharp/issues/comments/431653351","html_url":"https://github.com/empira/PDFsharp/issues/72#issuecomment-431653351","issue_url":"https://api.github.com/repos/empira/PDFsharp/issues/72","id":431653351,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTY1MzM1MQ==","user":{"login":"TH-Soft","id":16321330,"node_id":"MDQ6VXNlcjE2MzIxMzMw","avatar_url":"https://avatars0.githubusercontent.com/u/16321330?v=4","gravatar_id":"","url":"https://api.github.com/users/TH-Soft","html_url":"https://github.com/TH-Soft","followers_url":"https://api.github.com/users/TH-Soft/followers","following_url":"https://api.github.com/users/TH-Soft/following{/other_user}","gists_url":"https://api.github.com/users/TH-Soft/gists{/gist_id}","starred_url":"https://api.github.com/users/TH-Soft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TH-Soft/subscriptions","organizations_url":"https://api.github.com/users/TH-Soft/orgs","repos_url":"https://api.github.com/users/TH-Soft/repos","events_url":"https://api.github.com/users/TH-Soft/events{/privacy}","received_events_url":"https://api.github.com/users/TH-Soft/received_events","type":"User","site_admin":false},"created_at":"2018-10-21T09:36:14Z","updated_at":"2018-10-21T09:36:14Z","author_association":"CONTRIBUTOR","body":"It is by design that the FontResolver cannot be changed. Using AppDomains is the recommended solution if you cannot have it all in one FontResolver.  \r\nThat's how the software architect wanted to have it."}}
{"actor":{"display_login":"TH-Soft"}}