Forum Bugs

Problem with CSS

hamburg
Hi guys,

I got the following CSS Selector for a XML document:

*[type=number] {
	font-weight:bold;
	padding:5px;
}


When I watch the xml file in any browser the selected values are displayed bold an padding is set correctly too as expected.

When I pass this XML file to prince only the padding is set. No font settings "arrive" in the resulting pdf file.

Am I missing something here?

Thanks for your help.

I'm running prince on Mac OSX 10.7

Regards
mikeday
So the rule is definitely applying? If you specify "color: red" does that apply too? Are you applying any other CSS rules?
hamburg
Hi,

yeah it does apply. This is the complete css file at the moment.

* {
	font-family:Arial;
	font-size:10pt;
}

tournament, match {
	display: block;
}

tournament {
	padding:3px;
	border:1px solid black;
	margin-bottom:5px;
}

basic_value {
	padding:5px;
}

*[type=number] {
	font-weight:bold;
	color:red;
}

*[type*=team] {
	font-weight:bold;
	width:100px;
}


I was impressed by the speed of prince. Right now I'm using prawn but it is slow as hell when it comes to rendering pdf's with lots of tables and pages. Only advantage of prawn is the perfect control of the pagebreaks as you can "ask" a counter what it's actual position is. Before prawn I used PDFKit but I got frustrated with the page breaks as well and the performance sucked too.

So if prince works out in the pagebreak issue, this is really important, and formatting can be done the way i need it we will purchase your product.

Regards
jim_albright
Does the font you are specifying have /bold/?

Jim Albright
Wycliffe Bible Translators

hamburg
Rules are applied. The font is Arial and I'm pretty sure it has "bold".

This is the complete css file.

* {
	font-family:Arial;
	font-size:10pt;
}

tournament, match {
	display: block;
}

tournament {
	padding:3px;
	border:1px solid black;
	margin-bottom:5px;
}

basic_value {
	padding:5px;
}

*[type=number] {
	font-weight:bold;
	color:red;
}

*[type*=team] {
	font-weight:bold;
	width:100px;
}


And the XML file looks like this:

<?xml-stylesheet type="text/css" href="style.css"?><tournaments><tournament><name>UEFA Champions League</name><matches><match><basic_value type="number">416</basic_value><basic_value type="date">21.02.</basic_value><basic_value type="time">18:00</basic_value><basic_value type="team1">CSKA Moskau</basic_value><basic_value type="team2">Real Madrid</basic_value></match><match><basic_value type="number">417</basic_value><basic_value type="date">21.02.</basic_value><basic_value type="time">20:45</basic_value><basic_value type="team1">SSC Neapel</basic_value><basic_value type="team2">FC Chelsea</basic_value></match><match><basic_value type="number">418</basic_value><basic_value type="date">22.02.</basic_value><basic_value type="time">20:45</basic_value><basic_value type="team1">FC Basel</basic_value><basic_value type="team2">Bayern M&#252;nchen</basic_value></match><match><basic_value type="number">419</basic_value><basic_value type="date">22.02.</basic_value><basic_value type="time">20:45</basic_value><basic_value type="team1">O. Marseille</basic_value><basic_value type="team2">Inter Mailand</basic_value></match></matches></tournament></tournaments>


Any hints?
mikeday
Thanks for posting the document, it works for me when I try it here. What output do you get if you run Prince with the --verbose flag?
prince: Loading document...
prince: loading XML input: test.xml
prince: loading style sheet: style.css
prince: Converting document...
prince: used font: Arial, Regular
prince: used font: Arial, Bold
prince: Finished: success