Skip to content

Commit

Permalink
Add egd_font:load_binary/1
Browse files Browse the repository at this point in the history
  • Loading branch information
psyeugenic committed Apr 3, 2017
1 parent b7ab1fb commit 1cea959
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/egd_font.erl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

-module(egd_font).

-export([load/1, size/1, glyph/2]).
-export([load/1, load_binary/1, size/1, glyph/2]).
-include("egd.hrl").

%% Font represenatation in ets table
Expand Down Expand Up @@ -64,6 +64,9 @@ glyph(Font, Code) ->

load(Filename) ->
{ok, Bin} = file:read_file(Filename),
load_binary(Bin).

load_binary(Bin) when is_binary(Bin) ->
Font = erlang:binary_to_term(Bin),
load_font_header(Font).

Expand Down

0 comments on commit 1cea959

Please sign in to comment.