Wikipedia:Reference desk/Archives/Computing/2014 September 3

Computing desk
< September 2 << Aug | Sep | Oct >> September 4 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.



September 3

edit

Visual C++ Simple Game Programming

edit

So, from past questions, I'm learning C++ (and finding that I, actually, really love it as I get used to it). For my own interest, I'd like to make a simple game using it - nothing advanced, at the moment, I just want to make a box that moves around in an area, correctly collides with areas borders, and maybe has to avoid other boxes; just something to get a feel for the basics. At any rate, after a little research, it looks like there are all sorts of different packages and directions to start from, so I wanted to know if anyone has any suggestions. I'm not looking for the simplest route, but what would be most useful to work with long term/what would be worth knowing. If anyone has any experience or direction they can offer, I'd greatly appreciate it, thank you in advance:-)Phoenixia1177 (talk) 03:50, 3 September 2014 (UTC)[reply]

Simple DirectMedia Layer is a popular multimedia library that works on most platforms. You can use it to animate simple 2D and 3d graphics. Nimur (talk) 04:06, 3 September 2014 (UTC)[reply]
What operating system are you targetting, and what development environment are you using?--Phil Holmes (talk) 11:17, 3 September 2014 (UTC)[reply]
For a very simple game, there are indeed an insane number of libraries that'll help you get it done - and for that purpose, it doesn't much matter which one you choose. I think your decision as to which one to invest time into depends on what you ULTIMATELY want to get done rather than what the simple example needs. Most 'real' games rely on a bunch of different libraries - one for graphics, another for physics, another for sound and so forth. SteveBaker (talk) 14:51, 3 September 2014 (UTC)[reply]
I checked out SDL, it seems straightforward enough, I'm going to play with it this weekend. I'm using windows 7, visual express 2013 - I also have Code::Blocks, but haven't really used it. As for targeting, at the moment, no one - at most, I'd like to one day make something simple yet entertaining, basic 3d stuff graphically, nothing commercial grade (I'm not delusional); realistically, this will probably be more of a learning experience and way to pass the time, I like game programming related stuff because it challenges various skills and ends up with a fun result (and I like designing, so that's cool). @Steve, I'm not looking to make anything along the lines of what passes for a modern commercial game, however, I would like to learn something that had the ability to make one. In short, I want to learn something that people would actually use, even if I'm never going to use it for that end. Thank you all again for your help - with this question and my previous ones, actual programming is not something I have a lot of background in and while thrilling, I'm finding it to be a different sort of challenge, you all have been very helpful in getting me started with this:-)Phoenixia1177 (talk) 21:00, 3 September 2014 (UTC)[reply]

Chinese characters and Firefox

edit

Here on Wikipedia everything is fine, but when typing something in Google search bar or looking at Google results, Chinese characters look very odd. I think it's the Firefox default font. I have done some research and found someone else having the same issue: http://forums.mozillazine.org/viewtopic.php?f=38&t=1924991. The thread's answers are not very helpful and it is not a general problem as they assumed. It's a Firefox issue and it happens no matter which encoding I select. I'm a native speaker, so it was probably easier for me to find out that these odd forms actually do exist. They are Japanese standardized forms, therefore some strokes look different. It's the 黑体 font, translated as East Asian gothic typeface.
I thought Firefox did it because the characters are too small although I don't see how the Japanese standardized forms make characters smoother or even save space. So I increased the font size and the characters still stayed the same. It wasn't a size issue after all and 黑体 displays perfectly with Internet Explorer, Google Chrome and Microsoft Word at any size. Therefore it must be Japanese characters in 黑体. And I was wrong again. The fact is that they are still Chinese characters, but they are displayed as Japanese ones. If you copy those characters and paste them elsewhere, they look Chinese again. Moreover, Google results only show Chinese websites (I didn't set any country preferences).
Now the strangest thing is yet to be mentioned. I had increased the font size and there were actually two different fonts mixed together. 黑体 is a font where all strokes are equally thick, while 宋体 Song is a serif typeface. Again this happens only with Firefox. You can see it yourself even if you don't know the language. Paste a Chinese character for Google results and increase the font size to the maximum. I tried to find a pattern which font is used for which character and came to the conclusion that traditional Chinese characters which had not undergone simplification are in 黑体, while simplified characters are in 宋体. Finally, I still don't understand why Firefox mixes two fonts and I want to know if there's a method to change this. Hope you don't mind the use of paragraphs in favor of the long text's legibility. --2.245.175.56 (talk) 04:05, 3 September 2014 (UTC)[reply]

The same copy-pasted character looking Chinese or Japanese in different software is a consequence of Han unification and different font choices. A single row/column of characters appearing in a mixture of fonts is a result of font substitution. It is a practical necessity these days because no font covers all of Unicode. Firefox does its own font substitution internally, I think, but I don't know the rules. Normally the primary font would be used unless it didn't provide the character, but I would expect every Chinese and Japanese font to provide 令 (U+4EE4), the offending character from the forum thread you linked. I'm not sure your problem is the same as theirs; it looks like they are simply using a Japanese font for all characters in Firefox. Does your problem show up with 令 or only with more obscure characters?
Note that this problem is unrelated to Firefox's character encoding menu. The character encoding is what it is; the only time you might want to select an encoding manually is if Firefox's automatic detection gets it wrong, in which case you'd see gibberish, not regional variants of the correct characters. -- BenRG (talk) 20:49, 3 September 2014 (UTC)[reply]
Yes, it occurs with simple characters like 令. As mentioned above, it happens with all characters that haven't undergone simplification. You say that font substitution is used because no font covers all of Unicode, but 黑体 and 宋体 are able to display all characters, even new characters created for new chemical elements. It's likely Firefox used 黑体 Japanese Kanji, so they didn't contain simplified Chinese. Therefore they added them in another font, 宋体, which I don't understand as 黑体 handles simplified Chinese perfectly in Word. I'm convinced the thread covers the same problem. There are two fonts, but you can't tell them apart in that thread's screenshot because of the small font size. --2.245.175.56 (talk) 00:16, 4 September 2014 (UTC)[reply]
Try going to Tools → Options → Content tab → Advanced, in the "Fonts for:" dropdown select "Japanese", change the MS PMincho and MS (P)Gothic fonts to SimSun, and see if that fixes it. It will break the display of Japanese-language pages, of course.
There should be a way to override Firefox's regional font choice for a page instead of using this hack, but I don't know how to do it, and it's hard to research because searches like "firefox change language" and "firefox change script" get tons of irrelevant hits.
(Incidentally, I only know Japanese, and I was confused earlier because you referred to 黑体 and 宋体 fonts, and I knew those weren't Japanese fonts so I figured they were Chinese. I now realize that they're the styles called gothic and mincho in Japanese, not fonts. As you suggested, you're likely getting MS PGothic with fallback to SimSun.) -- BenRG (talk) 04:13, 4 September 2014 (UTC)[reply]
Here are a couple more pages that mention the problem: [1][2]. Firefox seems to prefer Japanese fonts to Chinese, and either it's hardcoded or the option to change it is hard to find. I did find another solution: if you set your preferred web page language to Chinese (Tools → Options → Content → Choose) then Google will display its interface in Chinese and Chinese fonts will be used. This will only work on web sites that pay attention to your language preference, though. -- BenRG (talk) 06:48, 4 September 2014 (UTC)[reply]
SimSun didn't work, so I changed them all to 宋体 like the Simplified Chinese settings, which solved the problem. When visiting Japanese pages, Kana is still supported. Thank you! --2.245.237.32 (talk) 19:59, 4 September 2014 (UTC)[reply]