« Photo gallery from TUG 2013 tr... | Home | TikZでマック・ペイントの床しいタイリングを描きましょう »

プリティプリントの試作

Sun 8 Dec 2013 by mskala Tags used: , , ,

今年「TeX & LaTeX Advent Calendar」に入りました。 14日に私の書き込みを書きます。 それ前このサーバにGeSHiと言うプリティプリントソフトを備え付けています。 この書き込みはGeSHiのテスト・ポストです。

C言語でUnicodeからBDDまで翻訳。

      subrange=bits_range_bdd((low_code<0x10000?
                               0xF0900000:
                               (low_code&     0x3F)+
                               ((low_code&   0xFC0)<<2)+
                               ((low_code& 0x3F000)<<4)+
                               ((low_code&0x1C0000)<<6)+
                               0xF0808080),
                              (high_code&     0x3F)+
                              ((high_code&   0xFC0)<<2)+
                              ((high_code& 0x3F000)<<4)+
                              ((high_code&0x1C0000)<<6)+
                              0xF0808080);
 
      srx=bdd_addref(bdd_and(subrange,bdd_nithvar(25)));
      bdd_delref(subrange);
      subrange=bdd_addref(bdd_and(srx,bdd_ithvar(24)));
      bdd_delref(srx);
      srx=bdd_addref(bdd_and(subrange,bdd_nithvar(17)));
      bdd_delref(subrange);

有限状のパーサーの中で行番号とコメントがあります。

  1. case 'H': /* half-width treated as narrow */
  2. case 'N': /* narrow or neutral */
  3. width=1;
  4. break;
  5.  
  6. case '0': /* zero-width - should only appear in user database */
  7. width=0;
  8. break;
  9.  
  10. default:
  11. /* ignore all others */
  12. break;
  13. }
  14. /* FALL THROUGH */
  15.  
  16. default:
  17. ps=psSTOP;
  18. break;
  19. }

面白いね?

2 comments

*
I wonder, what is it that you are so expectantly awaiting that you are writing software to mark the time? The birth of our lord Jesus Christ? Or a just an annual gathering of your large family and extensive group of friends?
JustATroll - 2013-12-08 13:36
*
December 25th is not a major religious or secular holiday in Japanese culture and counting down to it has no special significance for most participants in this project. The point here as I understand it is to have fun exchanging Web log entries on a theme of mutual interest, in this case TeX and LaTeX.
Matt - 2013-12-08 14:24


(optional field)
(optional field)
Answer "bonobo" here to fight spam. ここに「bonobo」を答えてください。SPAMを退治しましょう!
I reserve the right to delete or edit comments in any way and for any reason. New comments are held for a period of time before being shown to other users.