Changeset 572

Show
Ignore:
Timestamp:
09/19/07 06:26:53 (1 year ago)
Author:
shanoah
Message:

Fix gtk not to use depth_in_feat, allow greater sizes then 80x24, and add preliminary big tile support.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/xtra/angband.glade

    r560 r572  
    182182                                <property name="label" translatable="yes">David Gervais</property> 
    183183                                <property name="use_underline">True</property> 
    184                                 <property name="active">True</property> 
    185184                                <property name="group">graphics_0</property> 
    186185                                <signal name="activate" handler="on_graphics_activate" after="yes"/> 
     186                              </widget> 
     187                            </child> 
     188                            <child> 
     189                              <widget class="GtkSeparatorMenuItem" id="separatormenuitem3"> 
     190                                <property name="visible">True</property> 
     191                              </widget> 
     192                            </child> 
     193                            <child> 
     194                              <widget class="GtkCheckMenuItem" id="big_tile_item"> 
     195                                <property name="visible">True</property> 
     196                                <property name="label" translatable="yes">_Big Tile</property> 
     197                                <property name="use_underline">True</property> 
     198                                <signal name="activate" handler="on_big_tiles"/> 
    187199                              </widget> 
    188200                            </child> 
     
    470482            <property name="n_columns">2</property> 
    471483            <child> 
    472               <widget class="GtkLabel" id="label11"> 
    473                 <property name="visible">True</property> 
    474                 <property name="label" translatable="yes">Term Window 7</property> 
    475               </widget> 
    476               <packing> 
     484              <widget class="GtkFontButton" id="term_font_0"> 
     485                <property name="visible">True</property> 
     486                <property name="can_focus">True</property> 
     487                <property name="response_id">0</property> 
     488                <signal name="font_set" handler="set_term_font"/> 
     489              </widget> 
     490              <packing> 
     491                <property name="left_attach">1</property> 
     492                <property name="right_attach">2</property> 
     493              </packing> 
     494            </child> 
     495            <child> 
     496              <widget class="GtkFontButton" id="term_font_1"> 
     497                <property name="visible">True</property> 
     498                <property name="can_focus">True</property> 
     499                <property name="response_id">0</property> 
     500                <signal name="font_set" handler="set_term_font"/> 
     501              </widget> 
     502              <packing> 
     503                <property name="left_attach">1</property> 
     504                <property name="right_attach">2</property> 
     505                <property name="top_attach">1</property> 
     506                <property name="bottom_attach">2</property> 
     507              </packing> 
     508            </child> 
     509            <child> 
     510              <widget class="GtkFontButton" id="term_font_2"> 
     511                <property name="visible">True</property> 
     512                <property name="can_focus">True</property> 
     513                <property name="response_id">0</property> 
     514                <signal name="font_set" handler="set_term_font"/> 
     515              </widget> 
     516              <packing> 
     517                <property name="left_attach">1</property> 
     518                <property name="right_attach">2</property> 
     519                <property name="top_attach">2</property> 
     520                <property name="bottom_attach">3</property> 
     521              </packing> 
     522            </child> 
     523            <child> 
     524              <widget class="GtkFontButton" id="term_font_3"> 
     525                <property name="visible">True</property> 
     526                <property name="can_focus">True</property> 
     527                <property name="response_id">0</property> 
     528                <signal name="font_set" handler="set_term_font"/> 
     529              </widget> 
     530              <packing> 
     531                <property name="left_attach">1</property> 
     532                <property name="right_attach">2</property> 
     533                <property name="top_attach">3</property> 
     534                <property name="bottom_attach">4</property> 
     535              </packing> 
     536            </child> 
     537            <child> 
     538              <widget class="GtkFontButton" id="term_font_4"> 
     539                <property name="visible">True</property> 
     540                <property name="can_focus">True</property> 
     541                <property name="response_id">0</property> 
     542                <signal name="font_set" handler="set_term_font"/> 
     543              </widget> 
     544              <packing> 
     545                <property name="left_attach">1</property> 
     546                <property name="right_attach">2</property> 
     547                <property name="top_attach">4</property> 
     548                <property name="bottom_attach">5</property> 
     549              </packing> 
     550            </child> 
     551            <child> 
     552              <widget class="GtkFontButton" id="term_font_5"> 
     553                <property name="visible">True</property> 
     554                <property name="can_focus">True</property> 
     555                <property name="response_id">0</property> 
     556                <signal name="font_set" handler="set_term_font"/> 
     557              </widget> 
     558              <packing> 
     559                <property name="left_attach">1</property> 
     560                <property name="right_attach">2</property> 
     561                <property name="top_attach">5</property> 
     562                <property name="bottom_attach">6</property> 
     563              </packing> 
     564            </child> 
     565            <child> 
     566              <widget class="GtkFontButton" id="term_font_6"> 
     567                <property name="visible">True</property> 
     568                <property name="can_focus">True</property> 
     569                <property name="response_id">0</property> 
     570                <signal name="font_set" handler="set_term_font"/> 
     571              </widget> 
     572              <packing> 
     573                <property name="left_attach">1</property> 
     574                <property name="right_attach">2</property> 
     575                <property name="top_attach">6</property> 
     576                <property name="bottom_attach">7</property> 
     577              </packing> 
     578            </child> 
     579            <child> 
     580              <widget class="GtkFontButton" id="term_font_7"> 
     581                <property name="visible">True</property> 
     582                <property name="can_focus">True</property> 
     583                <property name="response_id">0</property> 
     584              </widget> 
     585              <packing> 
     586                <property name="left_attach">1</property> 
     587                <property name="right_attach">2</property> 
    477588                <property name="top_attach">7</property> 
    478589                <property name="bottom_attach">8</property> 
     
    480591            </child> 
    481592            <child> 
     593              <widget class="GtkLabel" id="label4"> 
     594                <property name="visible">True</property> 
     595                <property name="label" translatable="yes">Main Window</property> 
     596              </widget> 
     597            </child> 
     598            <child> 
     599              <widget class="GtkLabel" id="label5"> 
     600                <property name="visible">True</property> 
     601                <property name="label" translatable="yes">Term Window 1</property> 
     602              </widget> 
     603              <packing> 
     604                <property name="top_attach">1</property> 
     605                <property name="bottom_attach">2</property> 
     606              </packing> 
     607            </child> 
     608            <child> 
     609              <widget class="GtkLabel" id="label6"> 
     610                <property name="visible">True</property> 
     611                <property name="label" translatable="yes">Term Window 2</property> 
     612              </widget> 
     613              <packing> 
     614                <property name="top_attach">2</property> 
     615                <property name="bottom_attach">3</property> 
     616              </packing> 
     617            </child> 
     618            <child> 
     619              <widget class="GtkLabel" id="label7"> 
     620                <property name="visible">True</property> 
     621                <property name="label" translatable="yes">Term Window 3</property> 
     622              </widget> 
     623              <packing> 
     624                <property name="top_attach">3</property> 
     625                <property name="bottom_attach">4</property> 
     626              </packing> 
     627            </child> 
     628            <child> 
     629              <widget class="GtkLabel" id="label8"> 
     630                <property name="visible">True</property> 
     631                <property name="label" translatable="yes">Term Window 4</property> 
     632              </widget> 
     633              <packing> 
     634                <property name="top_attach">4</property> 
     635                <property name="bottom_attach">5</property> 
     636              </packing> 
     637            </child> 
     638            <child> 
     639              <widget class="GtkLabel" id="label9"> 
     640                <property name="visible">True</property> 
     641                <property name="label" translatable="yes">Term Window 5</property> 
     642              </widget> 
     643              <packing> 
     644                <property name="top_attach">5</property> 
     645                <property name="bottom_attach">6</property> 
     646              </packing> 
     647            </child> 
     648            <child> 
    482649              <widget class="GtkLabel" id="label10"> 
    483650                <property name="visible">True</property> 
     
    490657            </child> 
    491658            <child> 
    492               <widget class="GtkLabel" id="label9"> 
    493                 <property name="visible">True</property> 
    494                 <property name="label" translatable="yes">Term Window 5</property> 
    495               </widget> 
    496               <packing> 
    497                 <property name="top_attach">5</property> 
    498                 <property name="bottom_attach">6</property> 
    499               </packing> 
    500             </child> 
    501             <child> 
    502               <widget class="GtkLabel" id="label8"> 
    503                 <property name="visible">True</property> 
    504                 <property name="label" translatable="yes">Term Window 4</property> 
    505               </widget> 
    506               <packing> 
    507                 <property name="top_attach">4</property> 
    508                 <property name="bottom_attach">5</property> 
    509               </packing> 
    510             </child> 
    511             <child> 
    512               <widget class="GtkLabel" id="label7"> 
    513                 <property name="visible">True</property> 
    514                 <property name="label" translatable="yes">Term Window 3</property> 
    515               </widget> 
    516               <packing> 
    517                 <property name="top_attach">3</property> 
    518                 <property name="bottom_attach">4</property> 
    519               </packing> 
    520             </child> 
    521             <child> 
    522               <widget class="GtkLabel" id="label6"> 
    523                 <property name="visible">True</property> 
    524                 <property name="label" translatable="yes">Term Window 2</property> 
    525               </widget> 
    526               <packing> 
    527                 <property name="top_attach">2</property> 
    528                 <property name="bottom_attach">3</property> 
    529               </packing> 
    530             </child> 
    531             <child> 
    532               <widget class="GtkLabel" id="label5"> 
    533                 <property name="visible">True</property> 
    534                 <property name="label" translatable="yes">Term Window 1</property> 
    535               </widget> 
    536               <packing> 
    537                 <property name="top_attach">1</property> 
    538                 <property name="bottom_attach">2</property> 
    539               </packing> 
    540             </child> 
    541             <child> 
    542               <widget class="GtkLabel" id="label4"> 
    543                 <property name="visible">True</property> 
    544                 <property name="label" translatable="yes">Main Window</property> 
    545               </widget> 
    546             </child> 
    547             <child> 
    548               <widget class="GtkFontButton" id="term_font_7"> 
    549                 <property name="visible">True</property> 
    550                 <property name="can_focus">True</property> 
    551                 <property name="response_id">0</property> 
    552               </widget> 
    553               <packing> 
    554                 <property name="left_attach">1</property> 
    555                 <property name="right_attach">2</property> 
     659              <widget class="GtkLabel" id="label11"> 
     660                <property name="visible">True</property> 
     661                <property name="label" translatable="yes">Term Window 7</property> 
     662              </widget> 
     663              <packing> 
    556664                <property name="top_attach">7</property> 
    557665                <property name="bottom_attach">8</property> 
    558               </packing> 
    559             </child> 
    560             <child> 
    561               <widget class="GtkFontButton" id="term_font_6"> 
    562                 <property name="visible">True</property> 
    563                 <property name="can_focus">True</property> 
    564                 <property name="response_id">0</property> 
    565                 <signal name="font_set" handler="set_term_font"/> 
    566               </widget> 
    567               <packing> 
    568                 <property name="left_attach">1</property> 
    569                 <property name="right_attach">2</property> 
    570                 <property name="top_attach">6</property> 
    571                 <property name="bottom_attach">7</property> 
    572               </packing> 
    573             </child> 
    574             <child> 
    575               <widget class="GtkFontButton" id="term_font_5"> 
    576                 <property name="visible">True</property> 
    577                 <property name="can_focus">True</property> 
    578                 <property name="response_id">0</property> 
    579                 <signal name="font_set" handler="set_term_font"/> 
    580               </widget> 
    581               <packing> 
    582                 <property name="left_attach">1</property> 
    583                 <property name="right_attach">2</property> 
    584                 <property name="top_attach">5</property> 
    585                 <property name="bottom_attach">6</property> 
    586               </packing> 
    587             </child> 
    588             <child> 
    589               <widget class="GtkFontButton" id="term_font_4"> 
    590                 <property name="visible">True</property> 
    591                 <property name="can_focus">True</property> 
    592                 <property name="response_id">0</property> 
    593                 <signal name="font_set" handler="set_term_font"/> 
    594               </widget> 
    595               <packing> 
    596                 <property name="left_attach">1</property> 
    597                 <property name="right_attach">2</property> 
    598                 <property name="top_attach">4</property> 
    599                 <property name="bottom_attach">5</property> 
    600               </packing> 
    601             </child> 
    602             <child> 
    603               <widget class="GtkFontButton" id="term_font_3"> 
    604                 <property name="visible">True</property> 
    605                 <property name="can_focus">True</property> 
    606                 <property name="response_id">0</property> 
    607                 <signal name="font_set" handler="set_term_font"/> 
    608               </widget> 
    609               <packing> 
    610                 <property name="left_attach">1</property> 
    611                 <property name="right_attach">2</property> 
    612                 <property name="top_attach">3</property> 
    613                 <property name="bottom_attach">4</property> 
    614               </packing> 
    615             </child> 
    616             <child> 
    617               <widget class="GtkFontButton" id="term_font_2"> 
    618                 <property name="visible">True</property> 
    619                 <property name="can_focus">True</property> 
    620                 <property name="response_id">0</property> 
    621                 <signal name="font_set" handler="set_term_font"/> 
    622               </widget> 
    623               <packing> 
    624                 <property name="left_attach">1</property> 
    625                 <property name="right_attach">2</property> 
    626                 <property name="top_attach">2</property> 
    627                 <property name="bottom_attach">3</property> 
    628               </packing> 
    629             </child> 
    630             <child> 
    631               <widget class="GtkFontButton" id="term_font_1"> 
    632                 <property name="visible">True</property> 
    633                 <property name="can_focus">True</property> 
    634                 <property name="response_id">0</property> 
    635                 <signal name="font_set" handler="set_term_font"/> 
    636               </widget> 
    637               <packing> 
    638                 <property name="left_attach">1</property> 
    639                 <property name="right_attach">2</property> 
    640                 <property name="top_attach">1</property> 
    641                 <property name="bottom_attach">2</property> 
    642               </packing> 
    643             </child> 
    644             <child> 
    645               <widget class="GtkFontButton" id="term_font_0"> 
    646                 <property name="visible">True</property> 
    647                 <property name="can_focus">True</property> 
    648                 <property name="response_id">0</property> 
    649                 <signal name="font_set" handler="set_term_font"/> 
    650               </widget> 
    651               <packing> 
    652                 <property name="left_attach">1</property> 
    653                 <property name="right_attach">2</property> 
    654666              </packing> 
    655667            </child> 
     
    676688            <property name="n_columns">2</property> 
    677689            <child> 
    678               <widget class="GtkLabel" id="label13"> 
    679                 <property name="visible">True</property> 
    680                 <property name="label" translatable="yes">Message</property> 
    681               </widget> 
    682             </child> 
    683             <child> 
    684               <widget class="GtkLabel" id="label14"> 
    685                 <property name="visible">True</property> 
    686                 <property name="label" translatable="yes">Inventory</property> 
    687               </widget> 
    688               <packing> 
     690              <widget class="GtkFontButton" id="xtra_font_4"> 
     691                <property name="visible">True</property> 
     692                <property name="can_focus">True</property> 
     693                <property name="response_id">0</property> 
     694                <signal name="font_set" handler="set_xtra_font"/> 
     695              </widget> 
     696              <packing> 
     697                <property name="left_attach">1</property> 
     698                <property name="right_attach">2</property> 
     699                <property name="top_attach">5</property> 
     700                <property name="bottom_attach">6</property> 
     701              </packing> 
     702            </child> 
     703            <child> 
     704              <widget class="GtkFontButton" id="xtra_font_3"> 
     705                <property name="visible">True</property> 
     706                <property name="can_focus">True</property> 
     707                <property name="response_id">0</property> 
     708                <signal name="font_set" handler="set_xtra_font"/> 
     709              </widget> 
     710              <packing> 
     711                <property name="left_attach">1</property> 
     712                <property name="right_attach">2</property> 
     713                <property name="top_attach">4</property> 
     714                <property name="bottom_attach">5</property> 
     715              </packing> 
     716            </child> 
     717            <child> 
     718              <widget class="GtkFontButton" id="xtra_font_5"> 
     719                <property name="visible">True</property> 
     720                <property name="can_focus">True</property> 
     721                <property name="response_id">0</property> 
     722                <signal name="font_set" handler="set_xtra_font"/> 
     723              </widget> 
     724              <packing> 
     725                <property name="left_attach">1</property> 
     726                <property name="right_attach">2</property> 
     727                <property name="top_attach">3</property> 
     728                <property name="bottom_attach">4</property> 
     729              </packing> 
     730            </child> 
     731            <child> 
     732              <widget class="GtkFontButton" id="xtra_font_2"> 
     733                <property name="visible">True</property> 
     734                <property name="can_focus">True</property> 
     735                <property name="response_id">0</property> 
     736                <signal name="font_set" handler="set_xtra_font"/> 
     737              </widget> 
     738              <packing> 
     739                <property name="left_attach">1</property> 
     740                <property name="right_attach">2</property> 
     741                <property name="top_attach">2</property> 
     742                <property name="bottom_attach">3</property> 
     743              </packing> 
     744            </child> 
     745            <child> 
     746              <widget class="GtkFontButton" id="xtra_font_1"> 
     747                <property name="visible">True</property> 
     748                <property name="can_focus">True</property> 
     749                <property name="response_id">0</property> 
     750                <signal name="font_set" handler="set_xtra_font"/> 
     751              </widget> 
     752              <packing> 
     753                <property name="left_attach">1</property> 
     754                <property name="right_attach">2</property> 
    689755                <property name="top_attach">1</property> 
    690756                <property name="bottom_attach">2</property> 
     
    692758            </child> 
    693759            <child> 
     760              <widget class="GtkFontButton" id="xtra_font_0"> 
     761                <property name="visible">True</property> 
     762                <property name="can_focus">True</property> 
     763                <property name="response_id">0</property> 
     764                <signal name="font_set" handler="set_xtra_font"/> 
     765              </widget> 
     766              <packing> 
     767                <property name="left_attach">1</property> 
     768                <property name="right_attach">2</property> 
     769              </packing> 
     770            </child> 
     771            <child> 
     772              <widget class="GtkLabel" id="label18"> 
     773                <property name="visible">True</property> 
     774                <property name="label" translatable="yes">Debug</property> 
     775              </widget> 
     776              <packing> 
     777                <property name="top_attach">5</property> 
     778                <property name="bottom_attach">6</property> 
     779              </packing> 
     780            </child> 
     781            <child> 
     782              <widget class="GtkLabel" id="label17"> 
     783                <property name="visible">True</property> 
     784                <property name="label" translatable="yes">Monster List</property> 
     785              </widget> 
     786              <packing> 
     787                <property name="top_attach">4</property> 
     788                <property name="bottom_attach">5</property> 
     789              </packing> 
     790            </child> 
     791            <child> 
     792              <widget class="GtkLabel" id="label16"> 
     793                <property name="visible">True</property> 
     794                <property name="label" translatable="yes">Status</property> 
     795              </widget> 
     796              <packing> 
     797                <property name="top_attach">3</property> 
     798                <property name="bottom_attach">4</property> 
     799              </packing> 
     800            </child> 
     801            <child> 
    694802              <widget class="GtkLabel" id="label15"> 
    695803                <property name="visible">True</property> 
     
    702810            </child> 
    703811            <child> 
    704               <widget class="GtkLabel" id="label16"> 
    705                 <property name="visible">True</property> 
    706                 <property name="label" translatable="yes">Status</property> 
    707               </widget> 
    708               <packing> 
    709                 <property name="top_attach">3</property> 
    710                 <property name="bottom_attach">4</property> 
    711               </packing> 
    712             </child> 
    713             <child> 
    714               <widget class="GtkLabel" id="label17"> 
    715                 <property name="visible">True</property> 
    716                 <property name="label" translatable="yes">Monster List</property> 
    717               </widget> 
    718               <packing> 
    719                 <property name="top_attach">4</property> 
    720                 <property name="bottom_attach">5</property> 
    721               </packing> 
    722             </child> 
    723             <child> 
    724               <widget class="GtkLabel" id="label18"> 
    725                 <property name="visible">True</property> 
    726                 <property name="label" translatable="yes">Debug</property> 
    727               </widget> 
    728               <packing> 
    729                 <property name="top_attach">5</property> 
    730                 <property name="bottom_attach">6</property> 
    731               </packing> 
    732             </child> 
    733             <child> 
    734               <widget class="GtkFontButton" id="xtra_font_0"> 
    735                 <property name="visible">True</property> 
    736                 <property name="can_focus">True</property> 
    737                 <property name="response_id">0</property> 
    738                 <signal name="font_set" handler="set_xtra_font"/> 
    739               </widget> 
    740               <packing> 
    741                 <property name="left_attach">1</property> 
    742                 <property name="right_attach">2</property> 
    743               </packing> 
    744             </child> 
    745             <child> 
    746               <widget class="GtkFontButton" id="xtra_font_1"> 
    747                 <property name="visible">True</property> 
    748                 <property name="can_focus">True</property> 
    749                 <property name="response_id">0</property> 
    750                 <signal name="font_set" handler="set_xtra_font"/> 
    751               </widget> 
    752               <packing> 
    753                 <property name="left_attach">1</property> 
    754                 <property name="right_attach">2</property> 
     812              <widget class="GtkLabel" id="label14"> 
     813                <property name="visible">True</property> 
     814                <property name="label" translatable="yes">Inventory</property> 
     815              </widget> 
     816              <packing> 
    755817                <property name="top_attach">1</property> 
    756818                <property name="bottom_attach">2</property> 
     
    758820            </child> 
    759821            <child> 
    760               <widget class="GtkFontButton" id="xtra_font_2"> 
    761                 <property name="visible">True</property> 
    762                 <property name="can_focus">True</property> 
    763                 <property name="response_id">0</property> 
    764                 <signal name="font_set" handler="set_xtra_font"/> 
    765               </widget> 
    766               <packing> 
    767                 <property name="left_attach">1</property> 
    768                 <property name="right_attach">2</property> 
    769                 <property name="top_attach">2</property> 
    770                 <property name="bottom_attach">3</property> 
    771               </packing> 
    772             </child> 
    773             <child> 
    774               <widget class="GtkFontButton" id="xtra_font_5"> 
    775                 <property name="visible">True</property> 
    776                 <property name="can_focus">True</property> 
    777                 <property name="response_id">0</property> 
    778                 <signal name="font_set" handler="set_xtra_font"/> 
    779               </widget> 
    780               <packing> 
    781                 <property name="left_attach">1</property> 
    782                 <property name="right_attach">2</property> 
    783                 <property name="top_attach">3</property> 
    784                 <property name="bottom_attach">4</property> 
    785               </packing> 
    786             </child> 
    787             <child> 
    788               <widget class="GtkFontButton" id="xtra_font_3"> 
    789                 <property name="visible">True</property> 
    790                 <property name="can_focus">True</property> 
    791                 <property name="response_id">0</property> 
    792                 <signal name="font_set" handler="set_xtra_font"/> 
    793               </widget> 
    794               <packing> 
    795                 <property name="left_attach">1</property> 
    796                 <property name="right_attach">2</property> 
    797                 <property name="top_attach">4</property> 
    798                 <property name="bottom_attach">5</property> 
    799               </packing> 
    800             </child> 
    801             <child> 
    802               <widget class="GtkFontButton" id="xtra_font_4"> 
    803                 <property name="visible">True</property> 
    804                 <property name="can_focus">True</property> 
    805                 <property name="response_id">0</property> 
    806                 <signal name="font_set" handler="set_xtra_font"/> 
    807               </widget> 
    808               <packing> 
    809                 <property name="left_attach">1</property> 
    810                 <property name="right_attach">2</property> 
    811                 <property name="top_attach">5</property> 
    812                 <property name="bottom_attach">6</property> 
    813               </packing> 
     822              <widget class="GtkLabel" id="label13"> 
     823                <property name="visible">True</property> 
     824                <property name="label" translatable="yes">Message</property> 
     825              </widget> 
    814826            </child> 
    815827          </widget> 
  • trunk/src/cairo-utils.c

    r561 r572  
    6767                cairo_save(cr); 
    6868                c_rect(cr, r); 
     69                 
    6970                set_foreground_color(cr, c); 
    7071         
     
    113114                sx = (tile_w)/(font_w); 
    114115                sy = (tile_h)/(font_h); 
    115          
    116116                cairo_matrix_scale(&m, sx, sy); 
    117117        } 
     
    138138void draw_tiles( 
    139139cairo_t *cr, int x, int y, int n, const byte *ap, const char *cp, const byte *tap, const char *tcp,  
    140 font_info font, measurements tile) 
    141 
    142         cairo_rectangle_t char_rect; 
    143         cairo_matrix_t m; 
     140font_info *font, measurements *actual, measurements *tile) 
     141
     142        cairo_rectangle_t char_rect, r; 
    144143        int i; 
    145144         
     
    150149        if (cr !=NULL) 
    151150        { 
    152         /* Get a matrix set up to scale the graphics. */ 
    153         m = cairo_font_scaling(cr, tile.w, tile.h, font.w, font.h); 
     151        init_cairo_rect(&r, x * font->w, y * font->h,  actual->w * n, actual->h); 
     152         
     153        cairo_clear(cr, r, TERM_DARK); 
    154154         
    155155        /* Get the current position, Minus cx, which changes for each iteration */ 
    156156        cx = 0; 
    157         cy = (y * font.h); 
     157        cy = (y * font->h); 
    158158         
    159159        for (i = 0; i < n; i++) 
    160160        { 
    161                 /* Increment x 1 step */ 
    162                 cx += (x* font.w); 
    163                 init_cairo_rect(&char_rect, cx, cy, font.w, font.h); 
    164                  
     161                /* Increment x 1 step; use the font width because of equippy chars and the gap between  
     162                 * the status bar and the map. 
     163                 */ 
     164                cx += x * font->w; 
     165                init_cairo_rect(&char_rect, cx, cy, actual->w, actual->h); 
     166                 
     167                cairo_clear(cr, char_rect, TERM_DARK); 
    165168                /* Get the terrain tile, scaled to the font size */ 
    166                 tx= (tcp[i] & 0x7F) * font.w; 
    167                 ty = (tap[i] & 0x7F) * font.h; 
    168                  
    169                 draw_tile(cr, m, char_rect, tx, ty); 
     169                tx= (tcp[i] & 0x7F) * actual->w; 
     170                ty = (tap[i] & 0x7F) * actual->h; 
     171                 
     172                draw_tile(cr, matrix, char_rect, tx, ty); 
    170173         
    171174                /* If foreground is the same as background, we're done */ 
     
    173176                 
    174177                /* Get the foreground tile size, scaled to the font size */ 
    175                 tx = (cp[i] & 0x7F) * font.w; 
    176                 ty = (ap[i] & 0x7F) * font.h; 
    177          
    178                 draw_tile(cr, m, char_rect, tx, ty); 
     178                tx = (cp[i] & 0x7F) * actual->w; 
     179                ty = (ap[i] & 0x7F) * actual->h; 
     180         
     181                draw_tile(cr, matrix, char_rect, tx, ty); 
    179182        } 
    180183        } 
     
    216219} 
    217220 
    218 void draw_text(cairo_t *cr, font_info *font, int x, int y, int n, byte a, cptr s) 
     221void draw_text(cairo_t *cr, font_info *font, measurements *actual, int x, int y, int n, byte a, cptr s) 
    219222{ 
    220223        cairo_rectangle_t r; 
     
    224227        if (cr !=NULL) 
    225228        { 
    226         init_cairo_rect(&r, x * font->w, y * font->h,  font->w * n, font->h); 
    227          
     229        init_cairo_rect(&r, x * font->w, y * font->h,  actual->w * n, actual->h); 
     230         
     231        cairo_clear(cr, r, TERM_DARK); 
     232                 
    228233        /* Create a PangoLayout, set the font and text */ 
    229234        layout = pango_cairo_create_layout(cr);  
     
    235240         
    236241        /* Draw the text to the pixmap */ 
    237         cairo_move_to(cr, r.x, r.y); 
     242        cairo_move_to(cr, x * font->w, y * font->h); 
    238243         
    239244        pango_cairo_show_layout(cr, layout); 
  • trunk/src/cairo-utils.h

    r560 r572  
    4646cairo_surface_t* graphical_tiles; 
    4747cairo_pattern_t *tile_pattern; 
     48cairo_matrix_t matrix; 
    4849 
    4950/* Set the current color */ 
     
    6263extern void draw_tiles( 
    6364cairo_t *cr, int x, int y, int n, const byte *ap, const char *cp, const byte *tap, const char *tcp,  
    64 font_info font, measurements tile); 
     65font_info *font, measurements *actual, measurements *tile); 
    6566extern void cairo_draw_from_surface(cairo_t *cr, cairo_surface_t *surface, cairo_rectangle_t r); 
    6667extern void init_cairo(cairo_t *cr, cairo_surface_t *surface, measurements size); 
    6768extern void get_font_size(font_info *font); 
    68 extern void draw_text(cairo_t *cr, font_info *font, int x, int y, int n, byte a, cptr s); 
     69extern void draw_text(cairo_t *cr, font_info *font, measurements *actual, int x, int y, int n, byte a, cptr s); 
    6970#endif /* INCLUDED_CAIRO_UTILS_H*/ 
  • trunk/src/main-gtk.c

    r561 r572  
    4949static int drawing_win_width(term_data *td) 
    5050{ 
    51         return (td->cols * td->font.w); 
     51        return (td->cols * td->actual.w); 
    5252} 
    5353 
    5454static int drawing_win_height(term_data *td) 
    5555{ 
    56         return(td->rows * td->font.h); 
     56        return(td->rows * td->actual.h); 
    5757} 
    5858 
     
    7878} 
    7979 
     80void set_term_matrix(term_data *td) 
     81{ 
     82         
     83        /* Get a matrix set up to scale the graphics. */ 
     84        if (td->cr != NULL) 
     85                matrix = cairo_font_scaling(td->cr, td->tile.w, td->tile.h, td->actual.w, td->actual.h); 
     86} 
     87 
     88gboolean on_big_tiles(GtkWidget *widget, GdkEventButton *event, gpointer user_data) 
     89{ 
     90        term_data *td = &data[0]; 
     91         
     92        if (!gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) 
     93                use_bigtile = FALSE; 
     94        else 
     95                use_bigtile = TRUE; 
     96         
     97        load_font_by_name(td, td->font.name); 
     98        term_data_resize(td); 
     99        return(TRUE); 
     100} 
     101 
    80102static GdkRectangle cairo_rect_to_gdk(cairo_rectangle_t *r) 
    81103{ 
     
    126148        Term_activate(old); 
    127149} 
     150 
     151void set_row_and_cols(term_data *td) 
     152{ 
     153        int cols = td->cols; 
     154        int rows = td->rows; 
     155         
     156        td->cols = td->size.w / td->font.w; 
     157        td->rows= td->size.h / td->font.h; 
     158         
     159        if (MAIN_WINDOW(td)) 
     160        { 
     161                if (td->cols < 80) td->cols = cols; 
     162                if (td->rows < 24) td->rows = rows; 
     163        } 
     164         
     165        if ((cols != td->cols) || (rows != td->rows)) 
     166                term_data_resize(td); 
     167} 
     168 
    128169/*  
    129  * Get the position of the window and save it. Gtk being what it is, this is a major hack. 
    130  * It'd be nice to replace this with something cleaner... 
    131  * 
    132  * Given that I've majorly revised the window code since this was added, some of it  
    133  * may no longer be neccessary... 
     170 * Get the position of the window and save it. 
    134171 */ 
    135 static void get_size_pos(term_data *td) 
    136