In attempting to modify the font of my ActionBar
title I located an answer which suggested adjusting the Typeface
via a SpannableString
. While it works as noted in the answer, the placement seems to deviate from being vertically centered.
I have tried this with two different fonts, both OpenType (Roundhand) and TrueType (Billabong). In addition I have tried this on an older Gingerbread device (where the screenshot is from) running 2.3.3 as well as a via a newer Jelly Bean device running 4.2. The project makes use of ActionBarSherlock and thus is my last theoretical culprit. I have also adjusted the font size in hopes of it centering slightly but know that this is nothing more than a hack and is not solving the ultimate problem at hand.
With that, why is my title not centered appropriately and how can I correct it? If there is a way to adjust the alignment per the implemented solution referenced above that would certainly suffice, even if ActionBarSherlock is the culprit. Knowing what the culprit is and why this is occurring however is part of the answer, not just providing a workaround.
UPDATE:
Screenshot below making use of Show layout bounds. Please note that in order to make use of the Show layout bounds that this device is obviously running Jelly Bean whereas the previous screenshot was from a Gingerbread device. In either case, the problem is the same.
UPDATE:
If I use Typeface.DEFAULT
when I call setSpan
the bounds and alignment appear as they should.
UPDATE:
Upon trying a third font, it appears the issue is in fact tied to the fonts.