From: SourceForge.net <no...@so...> - 2006-11-19 00:23:55
|
Feature Requests item #1313263, was opened at 2005-10-04 15:51 Message generated for change (Comment added) made by apsen You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=384722&aid=1313263&group_id=25576 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: User Interface Group: For 5.12 Status: Open Resolution: None Priority: 5 Private: No Submitted By: Eddy Anthony (eddyanthony) Assigned to: apsen (apsen) Summary: Carriage Return support in OS Initial Comment: This is code/OS(PDF) change to support carriage return in spell descriptions. Some data tags (I do not remember which) support " &cr;" as instruction to put line break when outputted. I just extended that support to spell descriptions so I could put there actual spell text with paragraph breaks. I tested only with PDF sheets so html sheets may need some modifications as well. Also those changes were made around 5.8 release so to see actual changes you'll need to compare them to that code. It's up to you to see if the way I did it agrees with you standards but at least I hope it eventually makes in in one way or another. It would also be nice if someone would find it worth the time to put some support for tables there as well (or maybe I eventually get myself to see how hard is to do it). Andriy a_p_sen <ap...@op...> ---------------------------------------------------------------------- >Comment By: apsen (apsen) Date: 2006-11-18 19:23 Message: Logged In: YES user_id=1376183 Originator: NO &cr; in data files apparently is handled on load as by the time it gets to OS it is already \n. There's no hardcoded constants in the code except treatment of "\n" as \n in the replacement string. The filters read read regexps from system/outputFilters/re[format].lst and apply them to output in the order they are read. So & is converted by first line:[\046 &] ---------------------------------------------------------------------- Comment By: Chuck Pint (chuckpint) Date: 2006-11-18 17:16 Message: Logged In: YES user_id=901169 Originator: NO Do we have a new token to map &cr; and & to other characters? Or is the new code simply taking & and mapping it to &? ---------------------------------------------------------------------- Comment By: apsen (apsen) Date: 2006-11-18 17:00 Message: Logged In: YES user_id=1376183 Originator: NO This should be mostly done with help of regexp filters. I did not do much of HTML or none of TEXT export testing but PDF seems to work OK now. Anyway the code support should be complete and any work that may be left should be limited to OS. If someone could see if this is ready to be closed? PS It would be easy to add support for extended formatting of text fields ---------------------------------------------------------------------- Comment By: Chuck Pint (chuckpint) Date: 2006-08-22 19:38 Message: Logged In: YES user_id=901169 I think you have nailed it James. All the description fields should go thru the output filters. So if one silly SPROP has an "&" in it, the PDF output does not blow up. I think we need a new token, that in the OS sheet (HTML, text or base.xml) sets for that type of output, the mapping from &cr; to something else. You show the correct thing for HTML. For base.xml it would be "<para></para>". For text files, it may just want to be NULL, space, or something else (some of those statblocks are quite weird that way). While we're at it, we may want to think about other mapping. That silly "&" wants to map to & on HTML and base.xml. But it wants to map to "&" on text. ---------------------------------------------------------------------- Comment By: James Dempsey (jdempsey) Date: 2006-08-22 19:14 Message: Logged In: YES user_id=558288 After having a look at the patch, my main concern is that this change will have to be made to each tag that we want to use it on. I was wondering if we could do this differently and integrate it with the output filters? The filters are currently very simple, doing a character by character scan and convert of the output. However, if we could add multi-character entries such as &cr;=<br/> (for html) it would get all output and only be in the one location. One possible approach is to do a pre scan using regexps Some of the description fields currently bypass the output filters, so they will have to be dealt with separately. Given that we have other bugs reported regarding how the bypass has caused issues with PDF output, perhaps they should go back to using the output filters. Cheers, James. ---------------------------------------------------------------------- Comment By: Martijn Verburg (karianna) Date: 2006-08-22 03:59 Message: Logged In: YES user_id=252169 Hey aspen, now that you're part of the team, please feel free to commit your own work :-). Might be best to quickly pass it through James first though - K ---------------------------------------------------------------------- Comment By: apsen (apsen) Date: 2006-08-20 13:29 Message: Logged In: YES user_id=1376183 The only change in tokens is that DESC: token in spells and feats (and SA: if you choose to replicate the functionality in it) now are going through the same filter as BIO: etc. So they now understand "&cr;" in them. For example when you output them to pdf "&cr;" are replaced with </para><para>. Corresponding changed have been made to base.xml and fantasy *.xslt. I'm not aware if any changes would be required to *.html or *.txt. ---------------------------------------------------------------------- Comment By: apsen (apsen) Date: 2006-08-19 07:11 Message: Logged In: YES user_id=1376183 The only change in tokens is that DESC: token in spells and feats (and SA: if you choose to replicate the functionality in it) now are going through the same filter as BIO: etc. So they now understand "&cr;" in them. For example when you output them to pdf "&cr;" are replaced with </para><para>. Corresponding changed have been made to base.xml and fantasy *.xslt. I'm not aware if any changes would be required to *.html or *.txt. ---------------------------------------------------------------------- Comment By: Chuck Pint (chuckpint) Date: 2006-08-19 06:56 Message: Logged In: YES user_id=901169 What sort of changes in the OS? Have you changed the working of any tokens? We need to also have some idea of what changes need to make to the documentation. ---------------------------------------------------------------------- Comment By: apsen (apsen) Date: 2006-08-19 05:43 Message: Logged In: YES user_id=1376183 *.java and base.xml probably could be just taken as is but OSs itself have more changes in it so you would need to look what needs to be transfered and what not (for example there's also fix for missing date on later pages in there). ---------------------------------------------------------------------- Comment By: Martijn Verburg (karianna) Date: 2006-08-19 04:01 Message: Logged In: YES user_id=252169 James, I've attached the file, see what you make of it! >From Aspen: IIRC I had changes in SA but cannot find source code for that. I've included .class file in case you know some java decompiler :-) ---------------------------------------------------------------------- Comment By: Martijn Verburg (karianna) Date: 2006-08-18 09:28 Message: Logged In: YES user_id=252169 OK, just email me the file to martijnDOTverburgATgmailDOTcom, Anytime you can spare is good, but mail me on the address above and we can discuss further :-) ---------------------------------------------------------------------- Comment By: apsen (apsen) Date: 2006-08-18 09:25 Message: Logged In: YES user_id=1376183 There's no upload and attach link for me. Maybe since I'm not a member... I could spare some time... The question is how much... ---------------------------------------------------------------------- Comment By: Martijn Verburg (karianna) Date: 2006-08-18 08:51 Message: Logged In: YES user_id=252169 Well if you think you can spare some time, let me know, we're in desperate need of code monkeys who are willing to work in the OS area. There's a upload and attach file field at the bottom of this tracker. James, I'll hand over to you to patch it in :-) - K ---------------------------------------------------------------------- Comment By: apsen (apsen) Date: 2006-08-18 08:30 Message: Logged In: YES user_id=1376183 If you would like very low activity member :-) BTW How do I upload files here? ---------------------------------------------------------------------- Comment By: Martijn Verburg (karianna) Date: 2006-08-18 03:04 Message: Logged In: YES user_id=252169 Also, would you like to consider joining our team! :-) - K ---------------------------------------------------------------------- Comment By: James Dempsey (jdempsey) Date: 2006-08-17 17:33 Message: Logged In: YES user_id=558288 Hi Apsen, Could you upload it here please? We can try and get it implemented then. Cheers, James. ---------------------------------------------------------------------- Comment By: apsen (apsen) Date: 2006-08-17 17:22 Message: Logged In: YES user_id=1376183 I have code changes to support this in 5.10.1rc3(?) with addition to support CR in feat descriptions. I could provide it upon request. ---------------------------------------------------------------------- Comment By: apsen (apsen) Date: 2005-11-09 19:53 Message: Logged In: YES user_id=1376183 There updated code on yahoo pcgen list for pcgen version around 5.9.3 ParagraphSupportInSpellDescriptions.zip ---------------------------------------------------------------------- Comment By: apsen (apsen) Date: 2005-11-09 19:50 Message: Logged In: YES user_id=1376183 The code change is in ExportHandler to put SPELLMEM in the same category as BIO, DESC, NOTE and EQ - out of default filter; in SpellMemToken to use the same filter as in BIO, etc.; in base.xml to add paragraph notion to spells descriptions; and in master .xslt to use the paragraphs. ---------------------------------------------------------------------- Comment By: Chuck Pint (chuckpint) Date: 2005-10-04 16:22 Message: Logged In: YES user_id=901169 This is something that you have to be very careful with. &cr; is thrown away as whitespace in both the PDF and HTML OS. It turns out that tag itself has to deal with this. See the BIO tag for some ideas. Also, on HTML sheets in particular, the "size" of the sheet can be different depending on the browser, screen resolution, and other factors. So any hard-coded line breaks may occur in the wrong places. It would better to describe the problem you are trying to fix, rather that just putting in a fix. Could you try and describe the problem for us? My preference would be on one of the Yahoo discussion groups rather than via tracker comments. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=384722&aid=1313263&group_id=25576 |