The DataCAD Developer Network (DDN) is an online resource for information and support for DCAL® (DataCAD Applications Language) developers as well as anyone interested in creating fonts, toolbars, hatch patterns, or linetypes for use in DataCAD.
#13238 by devinder
Mon Aug 14, 2006 9:21 am
I have not tried in a DCAL program, but this should work.

Code: Select alltype
{This is DataCAD's internal record for display settings of TTF. Not to be modified}
    TDisplayTTF = PACKED RECORD
                          dooutline  : Boolean;
                          dofill     : Boolean;
                          OutlineClr : aSInt; {Valid values -1 or 1..255}
                          FillClr    : Integer; { Valid values -1 or 1..255 or RGBValue+1000}
{any -ve value means inherit color properties from the entity ie. ent.color}
                   END;

procedure inserttext(txtpoint : point; str : str255);
var
  dispttf : TDisplayTTF;
  ent : entity;
begin
   ent_init(ent,enttxt);
   ent.txtpnt:= txtpoint;
   ent.txtsiz := savevar.txtsiz;
   ent.txtang := savevar.txtang;
   ent.txtslant := savevar.txtslnt;
   ent.txtaspect := savevar.txtaspt;
   ent.txtBase := savevar.basez;
   ent.txtHite := savevar.hitez;
   ent.txtfon := savevar.fontName;
   ent.txtwinfont := savevar.txtwinfont;
   ent.txtstr := str;
   ent_add(ent);
   if savevar.txtwinfont then
   begin
      atr_init (atr, atr_str);
      atr.name := 'WFFontName';
     {DataCAD's internal attribute name that keeps Windows TTF FileName}
      atr.str := 'Times New Roman';
      if atr_add2ent(ent,atr) then
      begin
         atr_init (atr, atr_str);
         atr.name := 'TTFProp';
          {DataCAD's internal attribute name that keeps TTF Display colors/settings}
         dispttf.dooutline := true;
         dispttf.dofill:= true;
         dispttf.OutlineClr:= -1;
         dispttf.FillClr:= 1000 + RGB(255,128,0);
         setlength(atr.str,sizeof(dispttf));
         move(@dispttf,atr.str[1],sizeof(dispttf));
         atr_add2ent(ent,atr);
      end;
   end;
   ent_draw(ent, drmode_white)
end;

Who is online

Users browsing this forum: No registered users and 33 guests

About DataCAD Forum

The DataCAD Forum is a FREE online community we provide to enhance your experience with DataCAD.

We hope you'll visit often to get answers, share ideas, and interact with other DataCAD users around the world.

DataCAD

Software for Architects Since 1984