Thursday, November 13, 2014

Ubuntu Font and Centering

I tried to center my list of answers today. I don't know why I had so much trouble with this and in the end I only centered the top left corner of the list so that needs to be fixed. I also tried to use the Ubuntu font which you can get off of Google fonts. I think I am importing the downloaded font wrong and I am assuming that you can't use the URL from google fonts to import because I am not using the font on a website. You can see the google font here and how they suggest to use it(like 30ish pt font for header and 12ish pt for content).


1 comment:

  1. As we discussed, the Ubuntu font family is the one provided by the SDK, so there is no need to download it. Can you describe in more detail (in your first post on Monday) what you were doing to center the text and why you found it difficult? This is going to be important for UI design, so better to deal with it now.

    Assuming you have access to the following values:

    1. display_width
    2. text_width

    The starting point for centering the text would be given by:

    (display_width / 2) - (text_width / 2)

    Basically, you start at the middle of the screen and move to the left (subtract) half the length of the text you want to center.

    ReplyDelete