Browse Source

* changed org_to_cap, org_to_dec and org_to_base to shortints (from
Michael Knapp's gxtext unit, part of the GraphiX package)
* in settextstyle, the calculation of the ratios must be done with /,
not DIV!!

Jonas Maebe 26 years ago
parent
commit
cd377606a4
1 changed files with 13 additions and 7 deletions
  1. 13 7
      rtl/inc/graph/gtext.inc

+ 13 - 7
rtl/inc/graph/gtext.inc

@@ -48,9 +48,9 @@
         First_char: byte;     { first character in file               }
         First_char: byte;     { first character in file               }
         cdefs :     integer;  { offset to character definitions       }
         cdefs :     integer;  { offset to character definitions       }
         scan_flag:  byte;     { TRUE if char is scanable              }
         scan_flag:  byte;     { TRUE if char is scanable              }
-        org_to_cap: byte;     { Height from origin to top of capitol  }
-        org_to_base:byte;     { Height from origin to baseline        }
-        org_to_dec: byte;     { Height from origin to bot of decender }
+        org_to_cap: shortint; { Height from origin to top of capitol}
+        org_to_base:shortint; { Height from origin to baseline        }
+        org_to_dec: shortint; { Height from origin to bot of decender }
         _reserved: array[1..4] of char;
         _reserved: array[1..4] of char;
         Unused: byte;
         Unused: byte;
       end;
       end;
@@ -324,7 +324,7 @@
             then TextHeight:=8*CurrentTextInfo.CharSize
             then TextHeight:=8*CurrentTextInfo.CharSize
             else
             else
               TextHeight:=Trunc((fonts[Currenttextinfo.font].header.org_to_cap-
               TextHeight:=Trunc((fonts[Currenttextinfo.font].header.org_to_cap-
-                fonts[Currenttextinfo.font].header.org_to_base) * CurrentYRatio);
+                fonts[Currenttextinfo.font].header.org_to_dec) * CurrentYRatio);
       end;
       end;
 
 
     function TextWidth(const TextString : string) : word;
     function TextWidth(const TextString : string) : word;
@@ -617,8 +617,8 @@
          { This is only valid for stroked fonts }
          { This is only valid for stroked fonts }
          if (charsize <> usercharsize) then
          if (charsize <> usercharsize) then
          begin
          begin
-            CurrentXRatio := charsize div 4;
-            CurrentYRatio := charsize div 4;
+            CurrentXRatio := charsize / 4.0;
+            CurrentYRatio := charsize / 4.0;
          end;
          end;
          { if this is a stroked font then load it if not already loaded }
          { if this is a stroked font then load it if not already loaded }
          { into memory...                                               }
          { into memory...                                               }
@@ -691,7 +691,13 @@
 
 
 {
 {
 $Log$
 $Log$
-Revision 1.1  1999-09-22 13:13:36  jonas
+Revision 1.2  1999-09-22 13:30:52  jonas
+  * changed org_to_cap, org_to_dec and org_to_base to shortints (from
+    Michael Knapp's gxtext unit, part of the GraphiX package)
+  * in settextstyle, the calculation of the ratios must be done with /,
+    not DIV!!
+
+Revision 1.1  1999/09/22 13:13:36  jonas
   * renamed text.inc -> gtext.inc to avoid conflict with system unit
   * renamed text.inc -> gtext.inc to avoid conflict with system unit
   * fixed textwidth
   * fixed textwidth
   * isgraphmode now gets properly updated, so mode restoring works
   * isgraphmode now gets properly updated, so mode restoring works