I need to create a Graphics object from text but it needs to be left justified. I can do this for a single text string:
Graphics[
Text[
Style["programa_de_estabilidade_e_crescimento", 16]
, {1, 0}
, {1.6, 0}
]
, ImageSize -> {400, 20}
]
which results in:
But I need to do it automatically for different text sizes. E.g., using the same offset with the text string "programa" it results in:
So, is there a way to automatically adjust the offset?




ImageDimensions[ImageCrop[textImg["text"]]]from the second answer worked very well! – Miguel Sep 14 '17 at 18:00