Split a font's filename and its alias.
authorTilman Sauerbeck <tilman@code-monkey.de>
Wed, 8 Jun 2005 21:38:34 +0000 (21:38 +0000)
committerTilman Sauerbeck <tilman@code-monkey.de>
Wed, 8 Jun 2005 21:38:34 +0000 (21:38 +0000)
This makes it possible to decompile the Edje properly.

ChangeLog
lib/redact/app.rb
lib/redact/part.rb
lib/redact/redact.rb
lib/redact/source.rb

index 966f22acde85538fb5cf9e6f26b5ccc2c245fa88..fa2188aa54713d63595183e8180d960d14fc191d 100644 (file)
--- 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
index c7266d8c09b4e33e5a810fa84e38b4e09e6325e2..9e892db7bb3f0ff4302c82dec63d62d316afb72f 100644 (file)
@@ -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
index 313a29578feba103c968124d827db0d3238ec7e8..90a29776875acd36c849cc09752062ca47403475 100644 (file)
@@ -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
index 26b7c5fd133bfa45868ea1eb80bdc852a2d85c4a..7b9a802461c644048235570b3a8482df409f505d 100644 (file)
@@ -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
 
index 2662aff7dcf4a7a11d10ff6615d9538f382ff950..9a6d36376cba023eb9065919adbe127cae80189d 100644 (file)
@@ -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