{"action":"created","issue":{"url":"https://api.github.com/repos/mono/MonoGame/issues/4537","repository_url":"https://api.github.com/repos/mono/MonoGame","labels_url":"https://api.github.com/repos/mono/MonoGame/issues/4537/labels{/name}","comments_url":"https://api.github.com/repos/mono/MonoGame/issues/4537/comments","events_url":"https://api.github.com/repos/mono/MonoGame/issues/4537/events","html_url":"https://github.com/mono/MonoGame/pull/4537","id":133588619,"number":4537,"title":"[WIP] Spritefont styles","user":{"login":"Tzenchor","id":11319966,"avatar_url":"https://avatars.githubusercontent.com/u/11319966?v=3","gravatar_id":"","url":"https://api.github.com/users/Tzenchor","html_url":"https://github.com/Tzenchor","followers_url":"https://api.github.com/users/Tzenchor/followers","following_url":"https://api.github.com/users/Tzenchor/following{/other_user}","gists_url":"https://api.github.com/users/Tzenchor/gists{/gist_id}","starred_url":"https://api.github.com/users/Tzenchor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tzenchor/subscriptions","organizations_url":"https://api.github.com/users/Tzenchor/orgs","repos_url":"https://api.github.com/users/Tzenchor/repos","events_url":"https://api.github.com/users/Tzenchor/events{/privacy}","received_events_url":"https://api.github.com/users/Tzenchor/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-02-14T22:42:01Z","updated_at":"2016-02-22T00:29:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mono/MonoGame/pulls/4537","html_url":"https://github.com/mono/MonoGame/pull/4537","diff_url":"https://github.com/mono/MonoGame/pull/4537.diff","patch_url":"https://github.com/mono/MonoGame/pull/4537.patch"},"body":"**As of 20/02/2016 this is ready to test**\r\nI'm working on enabling the style tag of the spritefonts as talked in #4149. At this time i can find the font based on its filename or its family name if it is an installed font in Windows.\r\nThe changes at this time include:\r\n\r\n- Add 3 private fields to `FontDescriptionProcessor` that contains the supported font extensions, possible terminations of bold font files, and the possible terminations of italic font files.\r\n- Add method `FontDescriptionProcessor.FindFontByFileName`: Considers the fontname as the filename of the font, and tries to find the font file that better matches the name and the style (for example if the users wants \"arial\" bold, this finds \"arialb.ttf\"), the method relays heavily on LINQ and I have added comments in each step at least for now, but I don't mind removing them in future.\r\n- Add private class `FontDescriptionProcessor.FileInfoComparer`: Required in method `FontDescriptionProcessor.FindFontByFileName`\r\n- Update method `FontDescriptionProcessor.FindFontFileFromFontName` for Windows: Added style information to the method call and updated its logic.\r\n- Simplified method `FontDescriptionProcessor.Process`: Reworked the method to remove an `if` embedded inside an `#if` and make the procedure simpler.\r\n- Reorder the elements of `FontDescriptionStyle`, now Regular is 0, bold is 1, italic is 2, and by extension bold and italic is 3. Before Bold was 0, italic was 1 and regular was 2.\r\n\r\nBoth methods look for the best match for the users intentions, giving preference to the italic fonts (if requested).\r\n\r\nThe code  in `FontDescriptionProcessor.FindFontByFileName` is tested, and linked inside `FontDescriptionProcessor.Process`, but it's result is not used at this time as I want to make the other procedures needed.\r\n\r\nI'll need guidance with the following things:\r\n- To search in every folder using family names and to see what styles are available inside each font file i'll need to use SharpFont to read that data, but it feels wrong using it outside `SharpFontImporter`. The problem is that if I do this inside `SharpFontImporter` i'll have to move code from `FontDescriptionProcessor` to `SharpFontImporter`, i'm not sure what option is better.\r\n- Related to the previous point, for rendering the font styles manually I'm gonna need to have information about the found font to know what treatment it needs to get the expected style, and I can do it when retrieving each glyph from the font inside `SharpFontImporter` or after that when back in `FontDescriptionProcessor`\r\n- Also, to review the linux method `FontDescriptionProcessor.FindFontFileFromFontName` i'll need to have an example of the data retrieved in: [line of code](https://github.com/Tzenchor/MonoGame/commit/067476c80767113dd4cd8001b203148a70c649bf#diff-4e98352b3c096b0bf2a04d8f61626bc3L316) from anyone on linux and/or mac"},"comment":{"url":"https://api.github.com/repos/mono/MonoGame/issues/comments/186951374","html_url":"https://github.com/mono/MonoGame/pull/4537#issuecomment-186951374","issue_url":"https://api.github.com/repos/mono/MonoGame/issues/4537","id":186951374,"user":{"login":"tomspilman","id":103522,"avatar_url":"https://avatars.githubusercontent.com/u/103522?v=3","gravatar_id":"","url":"https://api.github.com/users/tomspilman","html_url":"https://github.com/tomspilman","followers_url":"https://api.github.com/users/tomspilman/followers","following_url":"https://api.github.com/users/tomspilman/following{/other_user}","gists_url":"https://api.github.com/users/tomspilman/gists{/gist_id}","starred_url":"https://api.github.com/users/tomspilman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomspilman/subscriptions","organizations_url":"https://api.github.com/users/tomspilman/orgs","repos_url":"https://api.github.com/users/tomspilman/repos","events_url":"https://api.github.com/users/tomspilman/events{/privacy}","received_events_url":"https://api.github.com/users/tomspilman/received_events","type":"User","site_admin":false},"created_at":"2016-02-22T00:29:54Z","updated_at":"2016-02-22T00:29:54Z","body":"@Tzenchor - All built...  ignore the \"Build Windows 10\" failure... that is from the old build setup.  The build is good."}}