Hosted by
 |
with Render_Glyphs; use Render_Glyphs;
package body Glyphs is
function Create
(Name : in String)
return Glyph
is
Result : Glyph := new Glyph_Record;
begin
Result.Name := To_Unbounded_String(Name);
return Result;
end Create;
function Get_Name
(This : in Glyph)
return String is
begin
return To_String(This.Name);
end Get_Name;
function Get_Bounds
(This : in Glyph)
return Box is
begin
return This.Bounds;
end Get_Bounds;
function Get_Outlines
(This : in Glyph)
return Outline_List is
begin
return This.Outlines;
end Get_Outlines;
procedure Add_Outline
(This : in Glyph;
Add : in Outline) is
begin
Outline_Lists.Push(This.Outlines, Add);
end Add_Outline;
function Get_Image
(This : in Glyph;
Staff_Height : in Real;
Aspect_Ratio : in Real;
Anti_Alias : in Positive)
return Glyph_Image is
begin
if This.Image = null
or else This.Image.Zoom /= Staff_Height
or else This.Image.Aspect_Ratio /= Aspect_Ratio
or else This.Image.Anti_Alias /= Anti_Alias
then
This.Image := Render(This, Staff_Height, Aspect_Ratio, Anti_Alias);
end if;
return This.Image;
end Get_Image;
procedure Set_Bounds
(This : in Glyph;
Left, Bottom : in Real;
Right, Top : in Real) is
begin
This.Bounds := Box'(Left, Bottom, Right, Top);
end Set_Bounds;
function Get_Width
(This : in Glyph)
return Real is
begin
return Get_Width(This.Bounds);
end Get_Width;
function Get_Height
(This : in Glyph)
return Real is
begin
return Get_Height(This.Bounds);
end Get_Height;
end Glyphs;
|