font size and type in asymptote [duplicate]

I am struggling to find font sizes and types for labels on my math figures in asymptote.

I am creating two images which should be essentially the same, but for a sphere and cylinder. I haven't been able to get the coloring and everything on the cylinder yet, but you can see in the images below that the text is too large and bold to be very presentable.

How do you specify better fonts for labels in figures?

Here are the codes and images:

import three;
import math;
import graph3;
import solids;
import fontsize;
size(7cm, 7cm);

settings.outformat = "eps";

real cylRadius = 1, cylLength = 6, contact_angle = pi/3;
real plane_height = cylRadius * cos(contact_angle);

defaultpen(fontsize(8pt));
defaultpen(Symbol(series="l",shape="n"));
defaultpen(linewidth(0.2));

// Plane of interface
real plane_x = cylLength + 2;
real plane_y = cylRadius + 2;
pen plane_color = yellow + opacity(0.1);
draw(surface((0, plane_y, plane_height)--(0, -plane_y, plane_height)--(-plane_x, -plane_y, plane_height)--(-plane_x, plane_y, plane_height)--cycle), plane_color);

// Points
label("$O$", O, S);
triple pB = (0, cylRadius * sin(contact_angle), plane_height);
label("$B$", pB, NE);
triple pA = (0, 0, plane_height);
label("$A$", pA, NW);
triple pH = (0, pB.y, cylRadius );

// Vectors
draw(O--pB,L=Label("$R$", align=S, position=MidPoint), Arrow3(DefaultHead3, size=3));
draw(O--pA,L=Label("$R \cos \theta$", align=W, position=MidPoint), Arrow3);
draw(pA--pB,L=Label("$R \sin \theta$", align=N, position=MidPoint));
draw(pB--pH,L=Label("$h$", align=E, position=MidPoint));

// Cylinder mesh
revolution cyl = cylinder(O, cylRadius, cylLength, (-1, 0, 0));
draw(surface(cyl), surfacepen=lightgrey+opacity(0), meshpen=grey+opacity(0.7));

// Intersection area
real intersection_width = 2 * cylRadius * sin(contact_angle);
path3 intersection_rectangle = plane((0, intersection_width, 0), (-cylLength, 0, 0), (0, -intersection_width/2, pB.z));
draw(surface(intersection_rectangle), grey+opacity(0.6));
draw(intersection_rectangle, darkgrey);
triple intersectionPoint = cylRadius * dir((contact_angle)*180/pi, 300);
triple intersectionLabelPoint = intersectionPoint + 0.2Z - 0.15Y;

// Cylindrical Cap
revolution cylCap = revolution(O, Arc(O, cylRadius, 0, 0, (contact_angle)*180/pi, 0, Y, 10), Z);
//draw(surface(cylCap), opacity(0.3)+red);
triple cylCapLabelPoint = cylCapPoint+0.2Z-0.15Y;

//Sphere without Spherical Cap
revolution cylWOCap = revolution(O, Arc(O, cylRadius, (contact_angle)*180/pi, 0, 180, 0, Y, 10), Z);
//draw(surface(cylWOCap), opacity(0.3) + lightblue+opacity(0.1));
triple cylWOCapPoint = cylRadius * dir((contact_angle)*180/pi+50, 300);
triple cylWOCapLabelPoint = cylWOCapPoint - 0.2Z - 0.15Y;

// Other
draw("$\theta$", arc(O, 0.2*pB, 0.2*pA), Arrow3);
draw(cylCapPoint .. cylCapPoint - 0.1Y + 0.1Z .. cylCapLabelPoint ,p=linewidth(0.2pt)+lightred, arrow=BeginArrow3(HookHead2,emissive(lightred)));
label("$A_{\alpha p}$", cylCapLabelPoint, N, lightred);

draw(cylWOCapPoint .. cylWOCapPoint-0.1Y-0.1Z .. cylWOCapLabelPoint ,p=linewidth(0.2pt)+lightblue, arrow=BeginArrow3(HookHead2,emissive(lightblue)));
label("$A_{\beta p}$", cylWOCapLabelPoint, S, lightblue);

draw(intersectionPoint .. intersectionPoint-0.1Y+0.1Z .. intersectionLabelPoint ,p=linewidth(0.2pt)+grey, arrow=BeginArrow3(HookHead2,emissive(grey)));
label("$A_{\alpha \beta}$", intersectionLabelPoint, W, grey);

//shipout(bbox(10mm));


Sphere:

import three;
import math;
import graph3;
import solids;
import fontsize;
size(7cm, 7cm);

real sphereRadius = 1, contact_angle = pi/3;
real plane_height = sphereRadius * cos(contact_angle);

//pen linepen=1.2bp;
defaultpen(fontsize(8pt));
defaultpen(Symbol(series="l",shape="n"));
defaultpen(linewidth(0.2));

// Plane of interface
real plane_xyz = sphereRadius * 1.2;
pen plane_color = yellow + opacity(0.1);
draw(surface((plane_xyz, plane_xyz, plane_height)--(plane_xyz, -plane_xyz, plane_height)--(-plane_xyz, -plane_xyz, plane_height)--(-plane_xyz, plane_xyz, plane_height)--cycle), plane_color);

// Points
label("$O$", O, S);
triple pB = (0, sphereRadius * sin(contact_angle), plane_height);
label("$B$", pB, NE);
triple pA = (0, 0, plane_height);
label("$A$", pA, NW);
triple pH = (0, pB.y, sphereRadius);

// Vectors
draw(O--pB,L=Label("$R$", align=S, position=MidPoint), Arrow3(DefaultHead3, size=3));
draw(O--pA,L=Label("$R \cos \theta$", align=W, position=MidPoint), Arrow3);
draw(pA--pB,L=Label("$R \sin \theta$", align=N, position=MidPoint));
draw(pB--pH,L=Label("$h$", align=E, position=MidPoint));

// Sphere mesh
draw(surface(sph), surfacepen=lightgrey+opacity(0), meshpen=grey+opacity(0.7));

// Intersection area
path3 intersection_circle = circle(pA, intersection_circle_radius, Z);
draw(surface(intersection_circle), grey+opacity(0.6));
draw(intersection_circle, darkgrey);
triple intersectionLabelPoint = intersectionPoint + 0.2Z - 0.15Y;

// Spherical Cap
revolution sphCap = revolution(O, Arc(O, sphereRadius, 0, 0, (contact_angle)*180/pi, 0, Y, 10), Z);
draw(surface(sphCap), opacity(0.3)+red);
triple sphCapLabelPoint = sphCapPoint+0.2Z-0.15Y;

//Sphere without Spherical Cap
revolution sphWOCap = revolution(O, Arc(O, sphereRadius, (contact_angle)*180/pi, 0, 180, 0, Y, 10), Z);
draw(surface(sphWOCap), opacity(0.3)+lightblue+opacity(0.1));
triple sphWOCapLabelPoint = sphWOCapPoint-0.2Z-0.15Y;

// Other

draw("$\theta$", arc(O, 0.2*pB, 0.2*pA), Arrow3);
draw(sphCapPoint .. sphCapPoint-0.1Y+0.1Z .. sphCapLabelPoint ,p=linewidth(0.2pt)+lightred, arrow=BeginArrow3(HookHead2,emissive(lightred)));
label("$A_{\alpha p}$", sphCapLabelPoint, N, lightred);

draw(sphWOCapPoint .. sphWOCapPoint-0.1Y-0.1Z .. sphWOCapLabelPoint ,p=linewidth(0.2pt)+lightblue, arrow=BeginArrow3(HookHead2,emissive(lightblue)));
label("$A_{\beta p}$", sphWOCapLabelPoint, S, lightblue);

draw(intersectionPoint .. intersectionPoint-0.1Y+0.1Z .. intersectionLabelPoint ,p=linewidth(0.2pt)+grey, arrow=BeginArrow3(HookHead2,emissive(grey)));
label("$A_{\alpha \beta}$", intersectionLabelPoint, W, grey);

//label(project(Label("$A_{\alpha \beta}$"), X, Y, intersectionLabelPoint, (0, -pB.y/2, plane_height+0.05));

//sphCapPoint .. controls sphCapPoint-0.1Y and sphCapPoint+.2Z .. sphCapPoint-0.1Y+.2Z
//draw("$\bm{R}$", O--pB, Arrow3, PenMargin3);
//draw("$\omega\bm{K}$", arc(0.9Z,0.2,90,-120,90,160,CW), 1.2N, Arrow3);

shipout(bbox(5mm));


I would like the fonts to look more similar to this in relative size to the figure such that they don't interfere with each other:

• The problem you are running into is that when you use a perspective point of view, labels closer to the camera will appear bigger. Commented Apr 8, 2014 at 20:20
• Your bigger problem is that your pictures are simply too small--especially the first. Try switching to size(14cm); it won't fix the fact that the font sizes appear different between the two pictures, but the first picture in particular will be much easier to read. Commented Apr 8, 2014 at 20:47