Changes

Jump to: navigation, search

BTC640/Text

986 bytes added, 11:09, 14 May 2013
Part 1
Definitions: glyphs, fonts, styles, rasterizing, serif, sans serif, anti-aliasing, true type fonts (TTF), PostScript.
Font attributes: point size, weight, slope, width.
More info about fonts: http://www.typesoffonts.com/ == Font availability ==
Almost every single computer has a different set of fonts available. A different set of fonts comes with every different version of the operating system, can be installed by applications, and installed by the user.
== Languages ==
English is the primary language of computers, but it's far from beeing the only one that matters. Operting Operating systems (Windows, OSX, Linux) and most software ships in many different languages and many non-english-speaking users never have the need to learn english to use a computer or the internet effectively.
To make use of different languages we separate the representation of the information (e.g. "Create" and "Créer") from the information itself (this is text that will be shown to the user and they will be able to click on it to create a page). Then a list of strings can be extracted from the software or website and translated into different languages without programming knowledge. Because the mapping of meaning to representation is static (only the language of the representation changes) the table can be easily dropped back into the software which is now available in an extra language.
= Lab =
This is a marked lab. Please submit it using Moodle (Lab1Lab2).Please keep in mind that you're supposed to complete the lab yourself, not just copy someone else's work. I will notice!
== Part 1 ==
You will need to do the following on two platforms (windows, linux, or mac). The windows with IE and /or matrix with Firefox and/or the OSX with Safari on the lab machines will work:
# Create an HTML page with:
## Simple headers in <h1>, <h2>, and <h3> tags. Don't specify any styles for the headers.
## Add some text in tags with CSS attributes that set the font, each of these separately:
### CSS font-family, with text explaining what this property can be used for. To make it more interesting - pick fonts only available on one platform and see what the fallback is.### CSS font-style, with text explaining what this property can be used for.### CSS font-size, with examples of using different unit types (see [http://kyleschaeffer.com/user-experience/css-font-size-em-vs-px-vs-pt-vs/ this for example]).
# Make sure the whole thing fits into one page (no scrolling), and make a screenshot of it.
# Open the exact same page on the other platform (preferably in a different browser), and make a screenshot of that.
# List In the same HTML file: list the differences you see, and explain why the two don't look exactly the same. Depending on the fonts you chose and the units you used the differences may be very minor.# The two screenshots, your css, and html file, and the explanation files must be submitted to MoodleBlackboard/Lab1Lab2.
== Part 2 ==
<pre>
 
#include <libintl.h>
#include <locale.h>
int main(void)
{
setlocale( LC_ALL, "" ); //bindtextdomain( "hello", "/usr/share/locale" ); bindtextdomain( "hello", "./locale" ); textdomain( "hello" );
printf( gettext( "Hello, world!\n")); printf("This is how you say 'crazy' in the current language: "); printf(gettext("crazy\n")); printf(gettext("Note that newlines at the end of the translated strings matter\n" ) );
return 0;
Run <pre>LC_ALL=fr_CA.UTF-8 ./hello</pre> and if you did everything right - you should see the translated string instead of the "Hello, world!" which you get from running ./hello without setting any variables.
Basically this means that your software will look different based on an environment variable (LC_ALL) so by changing one environment variable you can switch the language of all the software that's been translated into that language. Sadly our lab opensuse installations don't have  Try also to run some existing software on Matrix using various language packs installed for anythingcodes (e.g. de_DE, so you can't see it in actionzh_CN, find some others).
Submit the following for this part:
LC_ALL=fr_CA.UTF-8 ./hello
</pre>
 
== Submit ==
 
Please put all your files you want to submit into one zip file and upload that to Moodle.
1
edit

Navigation menu