I am generating a number of graphics using Mathematica that contain text. Adding the text to the graphic has been a considerable challenge, but I have finally come up with the following:
testg = Graphics[{Inset[
Graphics[Polygon[{{0, 0}, {10, 0}, {10, 10}, {0, 10}}],
ImageSize -> {90, 90}], {Left, Center}, {Left, Center}],
Inset[Graphics[
Inset[Cell[
TextData[{StyleBox["Text One\nText Two\n",
FontFamily -> "Arial", FontSize -> 30,
TextAlignment -> Left, LineSpacing -> {1, 0}],
StyleBox["Text Three", FontFamily -> "Arial", FontSize -> 12,
TextAlignment -> Left, LineSpacing -> {1, 0}]}]]],
ImageSize -> {125, 90}, ImageMargins -> 0, ImagePadding -> None,
AspectRatio -> Full], {Right, Center}, {Right, Center}]},
ImageSize -> {220, 90}, AspectRatio -> Full]
You will, no doubt, observe that the final graphic is produced by insetting the actual graphic (for demonstration purposes, I've made it just a rectangle) and then a cell with the text. I have had to size the rectangle to fit the text, and I have manually sized the text though trial and error. The composed image size is that of the two separate graphics with a bit of padding.
My question is, how can I resize this graphic on export? I would like to create much higher resolution images for use in a print environment.
Export["test.png", testg]
Setting the ImageSize on the export works to change the size of the PNG, but does not scale up the two Inset graphics. I need a way of doing this. As I will be producing many, many images, I would like to do this within Mathematica. Any help will be appreciated.
Alternative: I am actually very new to Mathematica, so a I would also be interested in better approach than mine.
Export["test.png", Rasterize[testg, RasterSize -> 1000, ImageResolution -> 1000], ImageSize -> 1000]
? $\endgroup$