From bf303d7901b8d8105571f66c1fa4fb7f0907bed4 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Wed, 8 Jun 2005 21:38:34 +0000 Subject: [PATCH] Split a font's filename and its alias. This makes it possible to decompile the Edje properly. --- ChangeLog | 4 +++- lib/redact/app.rb | 4 ++-- lib/redact/part.rb | 6 +++--- lib/redact/redact.rb | 8 +++++--- lib/redact/source.rb | 4 ++-- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 966f22a..fa2188a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,5 @@ -- -$Id: ChangeLog 47 2005-06-08 20:05:19Z tilman $ +$Id: ChangeLog 48 2005-06-08 21:38:34Z tilman $ ++ 2005-06-08 Tilman Sauerbeck (tilman at code-monkey de) @@ -12,6 +12,8 @@ $Id: ChangeLog 47 2005-06-08 20:05:19Z tilman $ * lib/redact/part.rb: Also set TextDescription::font if a matching FontDirectoryEntry was found * lib/redact/{redact,app}.rb: Improved imagedir support + * lib/redact/{app,redact,part,source}.rb: Split a font's filename and + its alias, so the Edje can be decompiled properly 2005-05-29 Tilman Sauerbeck (tilman at code-monkey de) * Rakefile: Use FileUtils.mkdir_p to create the destination diff --git a/lib/redact/app.rb b/lib/redact/app.rb index c7266d8..9e892db 100644 --- a/lib/redact/app.rb +++ b/lib/redact/app.rb @@ -1,5 +1,5 @@ #-- -# $Id: app.rb 43 2005-06-08 17:31:47Z tilman $ +# $Id: app.rb 48 2005-06-08 21:38:34Z tilman $ # # Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de) # @@ -200,7 +200,7 @@ EOT def dump_fonts(ef) EDJE.font_dir.each do |entry| - ef.write("fonts/#{entry.filename}", + ef.write("fonts/#{entry.alias}", File.read(entry.filename)) end end diff --git a/lib/redact/part.rb b/lib/redact/part.rb index 313a295..90a2977 100644 --- a/lib/redact/part.rb +++ b/lib/redact/part.rb @@ -1,5 +1,5 @@ #-- -# $Id: part.rb 47 2005-06-08 20:05:19Z tilman $ +# $Id: part.rb 48 2005-06-08 21:38:34Z tilman $ # # Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de) # @@ -558,9 +558,9 @@ module Redact found = EDJE.font_dir.find { |font| font.filename == f2 } if found.nil? EDJE.font_dir << FontDirectoryEntry.new(f2) - @font = EDJE.font_dir.last.filename + @font = EDJE.font_dir.last.alias else - @font = found.filename + @font = found.alias end else @font = f diff --git a/lib/redact/redact.rb b/lib/redact/redact.rb index 26b7c5f..7b9a802 100644 --- a/lib/redact/redact.rb +++ b/lib/redact/redact.rb @@ -1,5 +1,5 @@ #-- -# $Id: redact.rb 47 2005-06-08 20:05:19Z tilman $ +# $Id: redact.rb 48 2005-06-08 21:38:34Z tilman $ # # Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de) # @@ -142,10 +142,12 @@ module Redact end class FontDirectoryEntry # :nodoc: - attr_reader :filename + attr_reader :filename, :alias def initialize(filename) @filename = filename.to_str.dup.freeze + @alias = "Edje." + File.basename(@filename). + sub(/.[^.]+$/, "").freeze end protected @@ -154,7 +156,7 @@ module Redact end def to_eet_properties - {"entry" => [@filename]} + {"entry" => [@alias]} end end diff --git a/lib/redact/source.rb b/lib/redact/source.rb index 2662aff..9a6d363 100644 --- a/lib/redact/source.rb +++ b/lib/redact/source.rb @@ -1,5 +1,5 @@ #-- -# $Id: source.rb 1 2005-03-26 01:32:38Z tilman $ +# $Id: source.rb 48 2005-06-08 21:38:34Z tilman $ # # Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de) # @@ -62,7 +62,7 @@ module Redact def to_eet_properties {"file" => [@font.filename], - "name" => [@font.filename]} + "name" => [@font.alias]} end end -- 2.30.2