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">&amp;&amp;</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">&quot;geos_font_id&quot;</span>]=<span class="ruby-value str">&quot;$%02x&quot;</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">&quot;geos_font_point_ids&quot;</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">&quot;,&quot;</span>) - <span class="ruby-ivar">@meta_data</span>[<span class="ruby-value str">&quot;geos_font_point_sizes&quot;</span>]=<span class="ruby-identifier">point_sizes</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;,&quot;</span>) - <span class="ruby-ivar">@meta_data</span>[<span class="ruby-value str">&quot;geos_font_lengths&quot;</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">&quot;,&quot;</span>) -<span class="ruby-comment cmt"># point_sizes.each do |point_size| </span> -<span class="ruby-comment cmt"># prefix=&quot;geos_font_point_size_#{point_size}&quot; </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[&quot;#{prefix}_line_of_print&quot;]=font_data[0x00] </span> -<span class="ruby-comment cmt"># @meta_data[&quot;#{prefix}_bytes_in_bitstream&quot;]=bytes_in_bitstream(point_size) </span> -<span class="ruby-comment cmt"># @meta_data[&quot;#{prefix}_character_height&quot;]=char_height(point_size) </span> -<span class="ruby-comment cmt"># @meta_data[&quot;#{prefix}_character_width_space&quot;]=char_width(point_size,&quot; &quot;) </span> -<span class="ruby-comment cmt"># @meta_data[&quot;#{prefix}_character_width_A&quot;]=char_width(point_size,&quot;A&quot;) </span> -<span class="ruby-comment cmt"># @meta_data[&quot;#{prefix}_bitstream_A&quot;]=bitstreams(point_size,&quot;A&quot;) </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 &quot;# #{filename} #{point_size} #{char} #{start_of_char} - #{start_of_next_char}&quot; </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">&gt;&gt;</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 &quot;%08b:%08b==%08b&quot; % [byte,bitmask,byte &amp; 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">&amp;</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]=&quot;\n&quot; </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