more fixes for coin inline images

This commit is contained in:
Sumpfork 2012-08-22 01:18:48 +01:00
parent c9e3b07ae8
commit bc950ba09a
17 changed files with 31 additions and 25 deletions

View File

@ -31,3 +31,4 @@ old_images
sumpfork_dominion_tabs_v1.3.zip sumpfork_dominion_tabs_v1.3.zip
sumpfork_dominion_tabs_v1.4.zip sumpfork_dominion_tabs_v1.4.zip
sumpfork_dominion_tabs_v1.5.zip sumpfork_dominion_tabs_v1.5.zip
dominion_tabs.pdf

View File

@ -127,7 +127,7 @@ who played it still gets to draw 2 cards. Moat can also be
played on your turn as an Action to draw 2 cards. played on your turn as an Action to draw 2 cards.
:::Moneylender :::Moneylender
If you do not have a Copper in your hand to trash, If you do not have a Copper in your hand to trash,
you don't get the +3 coins to spend in the Buy phase. you don't get the +3 Coins to spend in the Buy phase.
:::Remodel :::Remodel
You cannot trash the Remodel as it isn't in your hand You cannot trash the Remodel as it isn't in your hand
when you resolve it (you can trash a different Remodel when you resolve it (you can trash a different Remodel
@ -135,7 +135,7 @@ card from your hand). If you do not have a card to
trash, you cannot gain a card from the Remodel. The trash, you cannot gain a card from the Remodel. The
gained card goes in your Discard pile. You can only gained card goes in your Discard pile. You can only
gain cards from the Supply. The gained card need not gain cards from the Supply. The gained card need not
cost exactly 2 coins more than the trashed card; it can cost exactly 2 Coins more than the trashed card; it can
cost that much or any amount less. You cannot use cost that much or any amount less. You cannot use
coins from Treasures or previous Actions (like the coins from Treasures or previous Actions (like the
Market) to increase the cost of the card you gain. You Market) to increase the cost of the card you gain. You
@ -193,7 +193,7 @@ with no Curses remaining, you will still draw 2 cards.
A player gaining a Curse puts it face-up into his A player gaining a Curse puts it face-up into his
Discard pile. Discard pile.
:::Woodcutter :::Woodcutter
During your Buy phase, you may add two coins to the During your Buy phase, you may add 2 Coins to the
total value of the Treasure cards played, and you may total value of the Treasure cards played, and you may
buy an additional card from the Supply. buy an additional card from the Supply.
:::Workshop :::Workshop
@ -292,12 +292,12 @@ from this Card.
Costs are 1 coin lower for all purposes. For example, if Costs are 1 coin lower for all purposes. For example, if
you played Village, then Bridge, then Workshop, you you played Village, then Bridge, then Workshop, you
could use Workshop to gain a Duchy (because Duchy now could use Workshop to gain a Duchy (because Duchy now
costs 4 coins due to the Bridge). Then if you played 3 costs 4 Coins due to the Bridge). Then if you played 3 Coins,
coins, you could buy a Silver (for 2 coins) and an Estate you could buy a Silver (for 2 Coins) and an Estate
(for 1 coin). Cards in players' decks are also affected. (for 1 coin). Cards in players' decks are also affected.
The effect is cumulative; if you Throne Room a Bridge, all The effect is cumulative; if you Throne Room a Bridge, all
cards will cost 2 coins less this turn. Costs never go below cards will cost 2 Coins less this turn. Costs never go below
0 coins. For this reason, if you play Bridge and then play 0 Coins. For this reason, if you play Bridge and then play
Upgrade, you could trash a Copper (which still costs zero, Upgrade, you could trash a Copper (which still costs zero,
even though you played Bridge) and gain a Pawn (which even though you played Bridge) and gain a Pawn (which
costs 1 after Bridge is played). costs 1 after Bridge is played).
@ -508,7 +508,7 @@ does not have enough cards to reveal 2, he reveals what he
can. You get bonuses for the types of cards revealed, can. You get bonuses for the types of cards revealed,
counting only the different cards. A card with 2 types counting only the different cards. A card with 2 types
gives you both bonuses. So if the player to your left gives you both bonuses. So if the player to your left
reveals Copper and Harem, you get +4 coins and +2 reveals Copper and Harem, you get +4 Coins and +2
cards; if he reveals 2 Silvers, you just get +2 coins. Curse cards; if he reveals 2 Silvers, you just get +2 coins. Curse
produces no bonus. produces no bonus.
:::Upgrade :::Upgrade
@ -773,7 +773,7 @@ card you revealed, put the revealed card in your
hand. If you do not name the right card, you put the hand. If you do not name the right card, you put the
revealed card back on top. revealed card back on top.
:::Potion :::Potion
This is a basic Treasure card. It costs 4 coins and produces Potion. It is This is a basic Treasure card. It costs 4 Coins and produces Potion. It is
not a Kingdom card. not a Kingdom card.
After you choose 10 Kingdom cards for the Supply, if any of them have After you choose 10 Kingdom cards for the Supply, if any of them have
@ -1495,7 +1495,7 @@ and is put into your discard pile.
:::Count :::Count
This card gives you two separate choices: first you either This card gives you two separate choices: first you either
discard 2 cards, put a card from your hand on top of your deck, or discard 2 cards, put a card from your hand on top of your deck, or
gain a Copper; after resolving that, you either get + Coins, trash your gain a Copper; after resolving that, you either get +3 Coins, trash your
hand, or gain a Duchy. For example, you might choose to discard hand, or gain a Duchy. For example, you might choose to discard
2 cards, then gain a Duchy. Gained cards come from the Supply 2 cards, then gain a Duchy. Gained cards come from the Supply
and are put into your discard pile. You can choose an option even and are put into your discard pile. You can choose an option even

View File

@ -170,14 +170,14 @@ You can't buy this if you have any Copper in play.
---------- ----------
While this is in play, when you buy a Victory card, gain a Gold. While this is in play, when you buy a Victory card, gain a Gold.
21 Bank Prosperity Treasure $7 Worth ? Coins. 21 Bank Prosperity Treasure $7 Worth ? Coins.
When you play this, it`s worth $1 per Treasure card you have in play (counting this). When you play this, it`s worth 1 Coin per Treasure card you have in play (counting this).
22 Expand Prosperity Action $7 Trash a card from your hand. Gain a card costing up to $3 more than the trashed card. 22 Expand Prosperity Action $7 Trash a card from your hand. Gain a card costing up to 3 Coins more than the trashed card.
23 Forge Prosperity Action $7 Trash any number of cards from your hand. Gain a card with cost exactly equal to the total cost in coins of the trashed cards. 23 Forge Prosperity Action $7 Trash any number of cards from your hand. Gain a card with cost exactly equal to the total cost in coins of the trashed cards.
24 King's Court Prosperity Action $7 You may choose an Action card in your hand. Play it three times. 24 King's Court Prosperity Action $7 You may choose an Action card in your hand. Play it three times.
25 Peddler Prosperity Action $8 +1 Card; +1 Action; +2 Coin 25 Peddler Prosperity Action $8 +1 Card; +1 Action; +2 Coin
---------- ----------
During your Buy phase, this costs $2 less per Action card you have in play, but not less than $0. During your Buy phase, this costs 2 Coins less per Action card you have in play, but not less than 0 Coins.
26 Platinum Prosperity Treasure $9 5 Coins. 26 Platinum Prosperity Treasure $9 Worth 5 Coins.
27 Colony Prosperity Victory $11 10 Victory. 27 Colony Prosperity Victory $11 10 Victory.
1 Black Market Promo Action $3 +2 Coins, Reveal the top 3 cards of the Black Market deck. You may buy one of them immediately. Put the unbought cards on the bottom of the Black Market deck in any order. 1 Black Market Promo Action $3 +2 Coins, Reveal the top 3 cards of the Black Market deck. You may buy one of them immediately. Put the unbought cards on the bottom of the Black Market deck in any order.
(Before the game, make a Black Market deck out of one copy of each Kingdom card not in the supply.). (Before the game, make a Black Market deck out of one copy of each Kingdom card not in the supply.).
@ -188,7 +188,7 @@ During your Buy phase, this costs $2 less per Action card you have in play, but
At the start of Clean-up, if you have this and no more than one other Action card in play, you may put this on top of your deck. At the start of Clean-up, if you have this and no more than one other Action card in play, you may put this on top of your deck.
5 Governor Promo Action $5 +1 Action 5 Governor Promo Action $5 +1 Action
Choose one; you get the version in parentheses: Each player gets +1 (+3) Cards; or each player gains a Silver (Gold); or each player may trash a card from his hand and gain a card costing exactly $1 ($2) more. Choose one; you get the version in parentheses: Each player gets +1 (+3) Cards; or each player gains a Silver (Gold); or each player may trash a card from his hand and gain a card costing exactly 1 Coin (2 Coins) more.
1 Copper Common Treasure $0 1 Coin. 1 Copper Common Treasure $0 1 Coin.
2 Curse Common Curse $0 -1 Victory. 2 Curse Common Curse $0 -1 Victory.
3 Estate Common Victory $2 1 Victory. 3 Estate Common Victory $2 1 Victory.
@ -199,14 +199,14 @@ Choose one; you get the version in parentheses: Each player gets +1 (+3) Cards;
1 Bag of Gold Cornucopia Action - Prize $0 +1 Action 1 Bag of Gold Cornucopia Action - Prize $0 +1 Action
Gain a Gold, putting it on top of your deck. Gain a Gold, putting it on top of your deck.
(This is not in the Supply.) (This is not in the Supply.)
2 Diadem Cornucopia Treasure - Prize $0 Worth $2. 2 Diadem Cornucopia Treasure - Prize $0 Worth 2 Coins.
When you play this, +1 Coins per unused Action you have (Action, not Action card). When you play this, +1 Coins per unused Action you have (Action, not Action card).
(This is not in the Supply.) (This is not in the Supply.)
3 Followers Cornucopia Action - Attack - Prize $0 +2 Cards 3 Followers Cornucopia Action - Attack - Prize $0 +2 Cards
Gain an Estate. Each other player gains a Curse and discards down to 3 cards in hand. Gain an Estate. Each other player gains a Curse and discards down to 3 cards in hand.
(This is not in the Supply.) (This is not in the Supply.)
4 Princess Cornucopia Action - Prize $0 +1 Buy 4 Princess Cornucopia Action - Prize $0 +1 Buy
While this is in play, cards cost $2 less, but not less than $0. While this is in play, cards cost 2 Coins less, but not less than 0 Coins.
(This is not in the Supply.) (This is not in the Supply.)
5 Trusty Steed Cornucopia Action - Prize $0 Choose two: +2 Cards; or +2 Actions; or +2 Coins; or gain 4 Silvers and put your deck into your discard pile. 5 Trusty Steed Cornucopia Action - Prize $0 Choose two: +2 Cards; or +2 Actions; or +2 Coins; or gain 4 Silvers and put your deck into your discard pile.
(This is not in the Supply.) (This is not in the Supply.)
@ -297,7 +297,7 @@ While this is in play, when you buy a card, gain a card costing less than it tha
19 Highway Hinterlands Action $5 +1 Card 19 Highway Hinterlands Action $5 +1 Card
+1 Action +1 Action
______________________ ______________________
While this is in play, cards cost $1 less, but not less than $0. While this is in play, cards cost 1 Coin less, but not less than 0 Coins.
20 Ill-Gotten Gains Hinterlands Treasure $5 Worth 1 Coin 20 Ill-Gotten Gains Hinterlands Treasure $5 Worth 1 Coin
When you play this, you may gain a Copper, putting it into your hand. When you play this, you may gain a Copper, putting it into your hand.
______________________ ______________________
@ -307,7 +307,7 @@ When you gain this, each other player gains a Curse.
Discard 2 cards. Discard 2 cards.
______________________ ______________________
When you gain this, look through your discard pile (including this), reveal any number of Action cards from it, and shuffle them into your deck. When you gain this, look through your discard pile (including this), reveal any number of Action cards from it, and shuffle them into your deck.
22 Mandarin Hinterlands Action $5 +3 coins 22 Mandarin Hinterlands Action $5 +3 Coins
Put a card from your hand on top of your deck. Put a card from your hand on top of your deck.
---------------------- ----------------------
When you gain this, put all Treasures you have in play on top of your deck in any order. When you gain this, put all Treasures you have in play on top of your deck in any order.
@ -321,7 +321,7 @@ Each other player draws a card, then discards down to 3 cards in hand.
When you gain this, gain a card costing less than this. When you gain this, gain a card costing less than this.
26 Farmland Hinterlands Victory $6 2 VP 26 Farmland Hinterlands Victory $6 2 VP
---------- ----------
When you buy this, trash a card from your hand. Gain a card costing exactly $2 more than the trashed card. When you buy this, trash a card from your hand. Gain a card costing exactly 2 Coins more than the trashed card.
1 Ruins Dark Ages Action - Ruins $0 Abandoned Mine: +1 Coin 1 Ruins Dark Ages Action - Ruins $0 Abandoned Mine: +1 Coin
Ruined Library: +1 Card Ruined Library: +1 Card
Ruined Marked: :1 Buy Ruined Marked: :1 Buy

View File

@ -58,6 +58,13 @@ class DominionTabs:
('Curse',) : 'curse.png' ('Curse',) : 'curse.png'
} }
def add_inline_images(self, text, fontsize):
replace = '<img src='"'images/coin_small_\\1.png'"' width=%d height='"'100%%'"' valign='"'middle'"'/>' % (fontsize*1.2)
text = re.sub('(\d)\s(c|C)oin(s)?', replace,text)
replace = '<img src='"'images/coin_small_question.png'"' width=%d height='"'100%%'"' valign='"'middle'"'/>' % (fontsize*1.2)
text = re.sub('\?\s(c|C)oin(s)?', replace,text)
return text
def drawTab(self,card,x,y,useExtra=False): def drawTab(self,card,x,y,useExtra=False):
#rightSide = False #rightSide = False
if self.numTabsHorizontal == 2: if self.numTabsHorizontal == 2:
@ -158,19 +165,17 @@ class DominionTabs:
for d in descriptions: for d in descriptions:
s = getSampleStyleSheet()['BodyText'] s = getSampleStyleSheet()['BodyText']
s.fontName = "Times-Roman" s.fontName = "Times-Roman"
replace = '<img src='"'images/coin_small_\\1.png'"' width=%d height='"'100%%'"' valign='"'middle'"'/>&nbsp;' % s.fontSize dmod = self.add_inline_images(d,s.fontSize)
dmod = re.sub('(\d) Coin(s)?', replace,d)
p = Paragraph(dmod,s) p = Paragraph(dmod,s)
textHeight = self.tabTotalHeight - self.tabLabelHeight + 0.2*cm textHeight = self.tabTotalHeight - self.tabLabelHeight + 0.2*cm
textWidth = self.tabWidth - cm textWidth = self.tabWidth - cm
w,h = p.wrap(textWidth,textHeight) w,h = p.wrap(textWidth,textHeight)
while h > textHeight: while h > textHeight:
s.fontSize -= 1 s.fontSize -= 1
s.leading -= 1 s.leading -= 1
#print 'decreasing fontsize on description for',card.name,'now',s.fontSize #print 'decreasing fontsize on description for',card.name,'now',s.fontSize
replace = '<img src='"'images/coin_small_\\1.png'"' width=%d height='"'100%%'"' valign='"'middle'"'/>' % s.fontSize dmod = self.add_inline_images(d,s.fontSize)
dmod = re.sub('(\d) Coin(s)?', replace,d)
p = Paragraph(dmod,s) p = Paragraph(dmod,s)
w,h = p.wrap(textWidth,textHeight) w,h = p.wrap(textWidth,textHeight)
p.drawOn(self.canvas,cm/2.0,textHeight-height-h-0.5*cm) p.drawOn(self.canvas,cm/2.0,textHeight-height-h-0.5*cm)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB