Hosted by
|
with Integer_Strings; use Integer_Strings;
with Enum_Strings; use Enum_Strings;
with Messages; use Messages;
with String_Tools; use String_Tools;
package body Boxes.Clefs is
function Create
(Clef : in Clef_Access)
return Clef_Box_Access
is
Result : Clef_Box_Access := new Clef_Box;
begin
Result.Clef := Clef;
return Result;
end Create;
procedure Layout
(This : access Clef_Box;
Font : access Font_Loader)
is
Sign : String := Get_Sign(This.Clef)'Img;
begin
if not Quiet then Debug("preparing clef layout"); end if;
To_Lower(Sign);
This.Glyph := Load_Glyph(Font, "clefs/hand/" & Sign);
This.Offset := 300.0 - 100.0 * Real(Get_Line(This.Clef));
This.Bounds := Get_Bounds(This.Glyph) + (0.0, This.Offset);
end Layout;
procedure Print
(This : access Clef_Box;
To : access Printer'Class;
Center : in Vector) is
begin
if not Quiet then Debug("printing clef"); end if;
Print(To, This.Glyph, This.Center + (0.0, This.Offset));
end Print;
end Boxes.Clefs;
|