You are not allowed to do AttachFile on this page. Login and try again.

    EdmondYap/Assignment3

Assignment 3

1, First let's review some font terminology. What is the baseline of a font? How are the ascender and decender heights related to the baseline?

The baseline is an imaginary line on the "bottom part" of a line of text(the bottom of letters 'a', 'n', 'd', not 'p'). The ascender (and its length) generally starts at the baseline to the top of the letter 'd'. The descender (and its length) generally starts at the baseline to the top of the letter 'p'.

As an example, we can use page 17 of the typography lecture. The baseline is at the bottom of the 'H'. The ascender is from there to the top of the 'd'. The descender is from there to the bottom of the 'p'.

2. Font sizes are often expressed in points (the argument to STFontFace::SetSize() is in units of points). One point is 1/72 of an inch. To display a font on screen at the correct size, the size of the font in pixels must be computed, which means we need to know the size of a pixel in inches. How many screen pixels would a 14 point font span if the screen has a resolution of 300 DPI (300 dots (pixels) per inch)? (notice that the STText and STFontFace classes return most information about fonts in units of pixels)

14 points * (1 inch / 72 points) * (300 pixels / 1 inch) = 58 1/3 pixels.

Taking a floor, if necessary to do, gives us 58 pixels.

3. Describe the correspondence between window coordinates and pixels that is established via the use of glViewport and glOrtho in the GLUT resize handler. After completely the assignment, it should be clear why it is wise to NOT to not modify this mapping in this assignment?

1 coordinate unit corresponds to 1 pixel. It is easier to work with this mapping, so we do not modify it.

Recent