doc/classes/C64GeosFont.src/M000192.html in ripxplore-0.12.0 vs doc/classes/C64GeosFont.src/M000192.html in ripxplore-0.13.0
- old
+ new
@@ -3,33 +3,39 @@
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
- <title>meta_data (C64GeosFont)</title>
+ <title>bitstreams (C64GeosFont)</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
- <pre><span class="ruby-comment cmt"># File lib/native_file_types/c64/C64GeosFont.rb, line 148</span>
-<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">meta_data</span>
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">super</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@contents</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Array</span>) <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">info_block</span>.<span class="ruby-identifier">nil?</span>
- <span class="ruby-ivar">@meta_data</span>[<span class="ruby-value str">"geos_font_id"</span>]=<span class="ruby-value str">"$%02x"</span> <span class="ruby-operator">%</span> (<span class="ruby-identifier">info_block</span>[<span class="ruby-value">0x80</span>]<span class="ruby-operator">+</span><span class="ruby-identifier">info_block</span>[<span class="ruby-value">0x81</span>]<span class="ruby-operator">*</span><span class="ruby-value">100</span>)
- <span class="ruby-ivar">@meta_data</span>[<span class="ruby-value str">"geos_font_point_ids"</span>]=(<span class="ruby-identifier">point_ids</span>.<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-value str">'$%04x'</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">x</span>}).<span class="ruby-identifier">join</span>(<span class="ruby-value str">","</span>)
- <span class="ruby-ivar">@meta_data</span>[<span class="ruby-value str">"geos_font_point_sizes"</span>]=<span class="ruby-identifier">point_sizes</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">","</span>)
- <span class="ruby-ivar">@meta_data</span>[<span class="ruby-value str">"geos_font_lengths"</span>]=(<span class="ruby-identifier">lengths</span>.<span class="ruby-identifier">collect</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-value str">'$%04x'</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">x</span>}).<span class="ruby-identifier">join</span>(<span class="ruby-value str">","</span>)
-<span class="ruby-comment cmt"># point_sizes.each do |point_size|
</span>
-<span class="ruby-comment cmt"># prefix="geos_font_point_size_#{point_size}"
</span>
-<span class="ruby-comment cmt"># font_data=@contents[point_size+1]
</span>
-<span class="ruby-comment cmt"># next if font_data.nil?
</span>
-<span class="ruby-comment cmt"># @meta_data["#{prefix}_line_of_print"]=font_data[0x00]
</span>
-<span class="ruby-comment cmt"># @meta_data["#{prefix}_bytes_in_bitstream"]=bytes_in_bitstream(point_size)
</span>
-<span class="ruby-comment cmt"># @meta_data["#{prefix}_character_height"]=char_height(point_size)
</span>
-<span class="ruby-comment cmt"># @meta_data["#{prefix}_character_width_space"]=char_width(point_size," ")
</span>
-<span class="ruby-comment cmt"># @meta_data["#{prefix}_character_width_A"]=char_width(point_size,"A")
</span>
-<span class="ruby-comment cmt"># @meta_data["#{prefix}_bitstream_A"]=bitstreams(point_size,"A")
</span>
-<span class="ruby-comment cmt"># end
</span>
-
- <span class="ruby-keyword kw">super</span>
+ <pre><span class="ruby-comment cmt"># File lib/native_file_types/c64/C64GeosFont.rb, line 150</span>
+<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">bitstreams</span>(<span class="ruby-identifier">point_size</span>,<span class="ruby-identifier">char</span>)
+ <span class="ruby-identifier">font_data</span>=<span class="ruby-ivar">@contents</span>[<span class="ruby-identifier">point_size</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>]
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">font_data</span>.<span class="ruby-identifier">nil?</span>
+ <span class="ruby-identifier">bit_stream_index</span>=<span class="ruby-identifier">font_data</span>[<span class="ruby-value">0x04</span>]<span class="ruby-operator">+</span><span class="ruby-value">0x100</span><span class="ruby-operator">*</span><span class="ruby-identifier">font_data</span>[<span class="ruby-value">0x05</span>]
+ <span class="ruby-identifier">bit_stream_base</span>=<span class="ruby-identifier">font_data</span>[<span class="ruby-value">0x06</span>]<span class="ruby-operator">+</span><span class="ruby-value">0x100</span><span class="ruby-operator">*</span><span class="ruby-identifier">font_data</span>[<span class="ruby-value">0x07</span>]
+ <span class="ruby-identifier">char_pointer</span>=<span class="ruby-value">2</span><span class="ruby-operator">*</span>((<span class="ruby-identifier">char</span>[<span class="ruby-value">0</span>]<span class="ruby-operator">%</span><span class="ruby-value">0x80</span>)<span class="ruby-operator">-</span><span class="ruby-value">0x20</span>)
+ <span class="ruby-identifier">start_of_char</span>=<span class="ruby-identifier">font_data</span>[<span class="ruby-identifier">char_pointer</span><span class="ruby-operator">+</span><span class="ruby-identifier">bit_stream_index</span>]<span class="ruby-operator">+</span><span class="ruby-value">0x100</span><span class="ruby-operator">*</span><span class="ruby-identifier">font_data</span>[<span class="ruby-identifier">char_pointer</span><span class="ruby-operator">+</span><span class="ruby-identifier">bit_stream_index</span><span class="ruby-operator">+</span><span class="ruby-value">1</span>]
+ <span class="ruby-identifier">start_of_next_char</span>=<span class="ruby-identifier">font_data</span>[<span class="ruby-identifier">char_pointer</span><span class="ruby-operator">+</span><span class="ruby-identifier">bit_stream_index</span><span class="ruby-operator">+</span><span class="ruby-value">2</span>]<span class="ruby-operator">+</span><span class="ruby-value">0x100</span><span class="ruby-operator">*</span><span class="ruby-identifier">font_data</span>[<span class="ruby-identifier">char_pointer</span><span class="ruby-operator">+</span><span class="ruby-identifier">bit_stream_index</span><span class="ruby-operator">+</span><span class="ruby-value">3</span>]
+<span class="ruby-comment cmt"># puts "# #{filename} #{point_size} #{char} #{start_of_char} - #{start_of_next_char}"
</span>
+ <span class="ruby-identifier">bitstream</span>=[]
+ <span class="ruby-identifier">char_height</span>(<span class="ruby-identifier">point_size</span>).<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">bitstream</span>[<span class="ruby-identifier">line</span>]=[]
+ <span class="ruby-identifier">bit_counter</span>=<span class="ruby-value">0</span>
+ <span class="ruby-identifier">start_of_line_bitstream</span>=<span class="ruby-identifier">line</span><span class="ruby-operator">*</span><span class="ruby-identifier">bytes_in_bitstream</span>(<span class="ruby-identifier">point_size</span>)<span class="ruby-operator">+</span><span class="ruby-identifier">bit_stream_base</span>
+ (<span class="ruby-identifier">start_of_char</span><span class="ruby-operator">..</span><span class="ruby-identifier">start_of_next_char</span><span class="ruby-operator">-</span><span class="ruby-value">1</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">bit_offset</span><span class="ruby-operator">|</span>
+ <span class="ruby-identifier">byte_offset</span>=<span class="ruby-identifier">bit_offset</span><span class="ruby-operator">/</span><span class="ruby-value">8</span>
+ <span class="ruby-identifier">bitmask</span>=<span class="ruby-value">0</span><span class="ruby-identifier">b10000000</span><span class="ruby-operator">>></span>(<span class="ruby-identifier">bit_offset</span> <span class="ruby-operator">%</span> <span class="ruby-value">8</span>)
+ <span class="ruby-identifier">byte</span>=<span class="ruby-identifier">font_data</span>[<span class="ruby-identifier">start_of_line_bitstream</span><span class="ruby-operator">+</span><span class="ruby-identifier">byte_offset</span>]
+<span class="ruby-comment cmt"># puts "%08b:%08b==%08b" % [byte,bitmask,byte & bitmask]
</span>
+ <span class="ruby-identifier">bitstream</span>[<span class="ruby-identifier">line</span>][<span class="ruby-identifier">bit_counter</span>]=(((<span class="ruby-identifier">byte</span> <span class="ruby-operator">&</span> <span class="ruby-identifier">bitmask</span>)<span class="ruby-operator">!=</span><span class="ruby-value">0</span>)<span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>)
+ <span class="ruby-identifier">bit_counter</span><span class="ruby-operator">+=</span><span class="ruby-value">1</span>
+ <span class="ruby-keyword kw">end</span>
+<span class="ruby-comment cmt"># bitstream[line][bit_counter]="\n"
</span>
+ <span class="ruby-keyword kw">end</span>
+ <span class="ruby-identifier">bitstream</span>
<span class="ruby-keyword kw">end</span></pre>
</body>
</html>
\ No newline at end of file