{"action":"opened","issue":{"url":"https://api.github.com/repos/Microsoft/WinObjC/issues/1661","repository_url":"https://api.github.com/repos/Microsoft/WinObjC","labels_url":"https://api.github.com/repos/Microsoft/WinObjC/issues/1661/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/WinObjC/issues/1661/comments","events_url":"https://api.github.com/repos/Microsoft/WinObjC/issues/1661/events","html_url":"https://github.com/Microsoft/WinObjC/issues/1661","id":199679862,"number":1661,"title":"Islandwood News: Missing 'video' and 'slideshow' images - they show up as small grey squares","user":{"login":"tadam-msft","id":21350288,"avatar_url":"https://avatars.githubusercontent.com/u/21350288?v=3","gravatar_id":"","url":"https://api.github.com/users/tadam-msft","html_url":"https://github.com/tadam-msft","followers_url":"https://api.github.com/users/tadam-msft/followers","following_url":"https://api.github.com/users/tadam-msft/following{/other_user}","gists_url":"https://api.github.com/users/tadam-msft/gists{/gist_id}","starred_url":"https://api.github.com/users/tadam-msft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tadam-msft/subscriptions","organizations_url":"https://api.github.com/users/tadam-msft/orgs","repos_url":"https://api.github.com/users/tadam-msft/repos","events_url":"https://api.github.com/users/tadam-msft/events{/privacy}","received_events_url":"https://api.github.com/users/tadam-msft/received_events","type":"User","site_admin":false},"labels":[{"id":400586057,"url":"https://api.github.com/repos/Microsoft/WinObjC/labels/Area-Foundation","name":"Area-Foundation","color":"f9d0c4","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-09T22:26:59Z","updated_at":"2017-01-09T22:26:59Z","closed_at":null,"body":"**Repro Steps**\r\nImages sometimes get obscured with a dark grey surface with a black rectangle (bottom right hand corner)\r\n![attachfilehandler](https://cloud.githubusercontent.com/assets/21350288/21786171/8dbbc98e-d677-11e6-920c-cf79abec7164.jpg)\r\n\r\n\r\n**Comments**\r\nJingtao Huang \r\nSeems like a bug. When you say ‘slideshow’ image, you mean something like an icon that looks like this , right? (This is from the Photos app, I imagine the reference platform button would look a little different) If so,  small squares are a ‘default’/character-not-found glyph in most fonts, they represent that there was no glyph data stored at that index in the font.\r\nI notice that the button to the right of the search bar is also character-not-found, so it’s probably the same root cause? (I tried two articles in hunt of a slideshow icon, but they both ended up crashing)\r\nIn October I made a commit c79a2b6372931389b5456b36eb1c310c3676b29f that switched some fonts used in IWNews – when we merged CT-DW, we regressed the ability to load fonts from ttf files/the app bundle. (We have since reimplemented this functionality) One of the changes made was from a non-system default font (ICEAppleGlyphs) to Lucida Sans Regular, and we never changed it back. I also notice that if I break on your code snippet, the first hit uses the font Lucida Sans Regular. I’m guessing that the root cause is that Lucida Sans Regular doesn’t actually have this glyph that we’re supposed to be able to get from ICEAppleGlyphs.\r\n\r\nJared Henderson (3 days ago)\r\nI think I’ve narrowed it down to a font/glyph issue.  It looks like this code:  \r\n \r\n    NSString *text = [NSString stringWithCharacters:&glyph length:1]; // ‘glyph’ = 57747 in this case\r\n    // set the font type and size\r\n    UIFont *font = [axpApplication.appConfig fontFromFontReference:@\"AXPGlyphFont\"];\r\n    CGFloat fontSize = MIN(size.height, size.width);\r\n    font = [font fontWithSize:fontSize];\r\n    \r\n    NSDictionary *attrDict = [NSDictionary dictionaryWithObjectsAndKeys:\r\n                              font, NSFontAttributeName,\r\n                              textColor, NSForegroundColorAttributeName,\r\n                              nil];\r\n    \r\n    CGSize textSize  = [text sizeWithAttributes:attrDict];\r\n    UIGraphicsBeginImageContextWithOptions(size,NO,0.0);\r\n    \r\n    // optional: add a shadow, to avoid clipping the shadow you should make the context size bigger\r\n    //\r\n    // CGContextRef ctx = UIGraphicsGetCurrentContext();\r\n    // CGContextSetShadowWithColor(ctx, CGSizeMake(1.0, 1.0), 5.0, [[UIColor grayColor] CGColor]);\r\n    if (textColor)\r\n    {\r\n        CGContextSetFillColorWithColor(UIGraphicsGetCurrentContext(), [textColor CGColor]);\r\n    }\r\n    [text drawAtPoint:CGPointMake((size.width - textSize.width)/2, (size.height - textSize.height)/2) withAttributes:attrDict];\r\n    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();\r\n    UIGraphicsEndImageContext();\r\n \r\n…draws an incorrect image (it’s supposed to be a ‘slideshow’ image)\r\n\r\nJared Henderson (a month ago)\r\nThese are icons added by the app, although it's unclear why we're not rendering the expected icons.  If you run the app on iOS, you'll see that these grey squares should contain icons signifying that it's a link to a video, a link to a photo album, etc.\r\n"}}
{"actor":{"display_login":"tadam-msft"}}