sillsdev / ptx2pdf

XeTeX based macro package for typesetting USFM formatted (Paratext output) scripture files
21 stars 7 forks source link

v1.5.10 saving edits to a named project fails #390

Closed davidc86 closed 3 years ago

davidc86 commented 3 years ago

I wanted to start from scratch, in case the problem was with my CFG file. I selected Default and began setting up the various options as best I could remember to get them output back to what it was looking like before. Eventually it became the fine details that I couldn't remember, so I saved the CFG and exited out of PTXprint, and then I did a file compare between my correctly formatted CFG file and the new one.

I got everything back to how it needs to be except some of the fiddly notes settings; I left those as they were from PTXprint. Then I opened PTXprint, and I did NOT GET the last used CFG with the correct contents. I got a messed up generic setup!

image

NOTE: While it has the correct "project name", I never use non-advanced view. And it lost all my books (even though the title bar shows the list!), and I have been working on MRK, which was in the Single book window (now that is blank too).

Opening up the Advanced button, and poking around, I see where all the settings have reverted to some factory setup (which are NOT my default settings either).

Any clue why this is happening? It does this whether I open PTXprint itself (and it opens SelaruNewPublications) or I launch the SelaruNewPublications.cfg file. Either way it is not loading what is actually in that CFG file. So no matter what I do, PTXprint fails to open the config file, even though it was working just a minute ago.

The able to start new projects, save projects to new names, and to open previous projects needs to become rock solid. This is the front door for new users.

Is it possible the CFG is malformed? It is nearly identical to a working CFG. Is it possible there are missing files in the new project's folder that is throwing off PTXprint? Here is the CFG file:

[document] diglotsecprj = bookintro = True ch1pagebreak = False chapfrom = 1.000 chapto = 16.000 clabel = clabelbooks = PSA PRO MRK cloptimizepoetry = True clsinglecol = False clsinglecolbooks = FRT INT PSA PRO BAK GLO colgutterfactor = 4.000 columnshift = 16.000 customfigfolder = ${settingsdir}/SLU customfiglocn = True digitmapping = Default diglotpicsources = pri diglotprifraction = 50.000 diglotsecconfig = diglotsecfraction = 50.000 diglotsepnotes = True diglotswapside = False elipsizemptyvs = False exclusivefolder = False filterglossary = False firstparaindent = True fontbold = Charis SIL|Bold|true| fontbolditalic = Charis SIL|Bold Italic|true| fontextraregular = ||true| fontitalic = Charis SIL|Italic|true| fontregular = Charis SIL||true| glossarymarkupstyle = no glueredupwords = False hangpoetry = False ifchaplabels = True ifcolorfonts = False ifdiglot = False iffigcrop = False iffigexclwebapp = False iffighiderefs = False iffigplaceholders = False iffigskipmissing = False ifhidehboxerrors = False ifinclfigs = True ifletter = False iflinebreakon = False ifmainbodytext = True ifomitsinglechnum = True ifomitverseone = False ifrtl = ltr ifshowchapternums = True ifshowversenums = True ifspacing = False ifusepiclist = True imagetypepref = TIF JPG PNG BMP PDF includeimg = True indentunit = 0.500 introoutline = True lettershrink = 1.000 letterstretch = 5.000 linebreaklocale = marginalverses = False parallelrefs = True picresolution = preventorphans = False preventwidows = False script = Zyyy sectionheads = True sensitive = False showxtrachapnums = False spaceshrink = 50.000 spacestretch = 200.000 startpagenum = 1.000 subject = GEN JON MRK LUK ACT GAL EPH PHP COL 1TH 2TH 1TI 2TI TIT PHM JAS 1JN 2JN 3JN OTH TDX XXB BAK toc = False toctitle = Kitab Lanke Kisike toptobottom = ltr usetoc1 = True usetoc2 = False usetoc3 = True

[config] notes = Settings for all Selaru Publications pwd = version = 1.502

[fancy] enableborders = True endofbook = True endofbookpdf = ${settingsdir}/SLU/shared/ptxprint/EndofBookDesign.pdf pageborder = False pageborderfullpage = False sectionheader = False sectionheaderscale = 1.000 sectionheadershift = 0.000 versedecorator = False versedecoratorscale = 1.000 versedecoratorshift = 0.000

[footer] ftrcenter = -empty- ftrcenterpri = False ifftrtitlepagenum = True ifprintconfigname = False

[header] chvseparator = True footerposition = 0.800 hdrcenter = -empty- hdrcenterpri = False hdrleft = Page Number hdrleftpri = False hdrright = Reference Range hdrrightpri = False headerposition = 0.800 ifomitrhchapnum = False ifrhrule = True ifverses = False mirrorlayout = True ruleposition = 6.000

[notes] abovenotespace = 10.000 addcolon = False fnoverride = False fnomitcaller = True fnparagraphednotes = True fnresetcallers = True glossaryfootnotes = False horiznotespacemax = 27.000 horiznotespacemin = 7.000 ifblendfnxr = True iffnautocallers = True iffootnoterule = True ifxrautocallers = True includefootnotes = True includexrefs = True internotespace = 3.500 keepbookwithrefs = True xroverride = False xromitcaller = True xrparagraphednotes = True xrresetcallers = True

[paper] bottommarginfactor = 1.200 colgutteroffset = -3.500 columns = False fontfactor = 12.000 gutter = 8.000 height = 148mm, 210mm (A5) ifaddgutter = True ifcropmarks = False ifverticalrule = True ifwatermark = False margins = 12.000 pagesize = 148mm, 210mm (A5) sidemarginfactor = 1.000 topmarginfactor = 1.500 width = 148mm, 210mm (A5)

[paragraph] ifhyphenate = False ifjustify = True ifnothyphenate = False ifomithyphen = False ifusefallback = False linespacebase = False linespacing = 15.000 missingchars =

[project] backincludes = . book = MRK booklist = GEN JON MRK LUK ACT GAL EPH PHP COL 1TH 2TH 1TI 2TI TIT PHM JAS 1JN 2JN 3JN OTH TDX XXB BAK bookscope = single canonicalise = True colophontext = \pc \zcopyright \pc \zlicense \pc \zimagecopyrights

combinebooks = True copyright = © 2021 Yayasan Pemperdayaan Masyarakat Desa-KKT dan © 2021 Wycliffe Bible Translators, Inc. frontincludes = ${settingsdir}/SLU/shared/ptxprint/SelaruMarkusFrontMatter.pdf hideadvsettings = True ifcolophon = True ifinclbackpdf = False ifinclfrontpdf = True ifstarthalfpage = False ifusecustomsty = False ifusemodssty = False ifusemodstex = False ifusepremodstex = False interlang = interlinear = False license = pdfx1acompliant = False pgbreakcolophon = True processscript = False randompicposn = True ruby = False runscriptafter = False usechangesfile = False useprintdraftfolder = True

[scrmymr] syllables = False

[snippets] diglot = False fancyborders = True fancyintro = False pdfx1aoutput = False

[thumbtabs] background = rgb(193,125,17) groups = height = 9.000 ifthumbtabs = False length = 14.000 numtabs = 11.000 restart = False rotate = True rotatetype = 1 thumbiszthumb = False

davidc86 commented 3 years ago

Well, I got a new development. I tried to load it one more time and got a Python error pop up. And my machine Blue Screened due to KERNAL_SECURITY_CHECK_FAILURE. So that was a doozy. (Obviously my machine rebooted just fine, and I'm up and running again....but it does make me wonder what happened.)

davidc86 commented 3 years ago

Okay... I sorted it out. It was the (c) symbol I had in my other CFG file (which works!). You can see the symbol (x2) up in the CFG file I entered earlier.

Very. Strange. These symbols work just fine in one CFG file and fail in another. Maybe because the somehow got converted to USF-8 when copied into the new CFG. Weird. So, PTXprint can't handle USF-8? Surely it can, so maybe it's something else?

Anyway, the GOOD NEWS is that when I changed those codes to plain 3-characters (c) the CFG loaded just fine will all my settings!!!

mhosken commented 3 years ago

Thanks. I realise it's pretty brutal, but I've made it so that any non-UTF8 characters are dropped from config files on load. No idea how you ended up with non-UTF8 chars in there, but you probably did. Might one of your text editors loaded a .cfg file as UTF-8 and saved it with the system codepage of cp1252 rather than its original UTF-8? So hopefully, this will work next time you have this problem.

davidc86 commented 3 years ago

It may be that the BeyondCompare file compare editor did just that, when I copied the copyright text from one config file to another, it converted the (c) symbol to UTF-8. I do wonder why we don't do everything in UTF-8 now. I had understood that Paratext and Fieldworks and basically all our translation software now tries to make everything UTF-8. Is this not the case? It would be better to not "strip out" deviant characters, but rather mark them and let us know we need to fix them. Because just pitching them will be really weird too. (Like, "Hey! where did my copyright symbol go? I know I put it in there!") Thanks for putting up with our "user-messes".

markpenny commented 3 years ago

David, please try out 1.5.11 which went up to the server quietly a few hours ago. Mark

On Sun, Feb 14, 2021, 6:46 AM davidc86 notifications@github.com wrote:

It may be that the BeyondCompare file compare editor did just that, when I copied the copyright text from one config file to another, it converted the (c) symbol to UTF-8. I do wonder why we don't do everything in UTF-8 now. I had understood that Paratext and Fieldworks and basically all our translation software now tries to make everything UTF-8. Is this not the case? It would be better to not "strip out" deviant characters, but rather mark them and let us know we need to fix them. Because just pitching them will be really weird too. (Like, "Hey! where did my copyright symbol go? I know I put it in there!") Thanks for putting up with our "user-messes".

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sillsdev/ptx2pdf/issues/390#issuecomment-778651975, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADC4XFFTABPRI3MW3SEX4S3S623GHANCNFSM4XQAULTQ .

davidc86 commented 3 years ago

I'm surprised PTXprint doesn't handle UTF-8. I thought Paratext, FieldWorks, and Toolbox all switched over to UTF-8 some time ago. Anyway, now that we found the problem, it is recoverable. But deleting something in a users CFG file without letting them know might be unfriendly. Any reason the UTF-8 character could not be converted to whatever PTXprint uses?

davidc86 commented 3 years ago

Yes, the configuration file opens, but I already deleted out the offending UTF-8 characters.

mhosken commented 3 years ago

Supporting people directly editing .cfg files is out of scope for 'correct support'. If you mess up that file, you suffer the consequences. It is not considered a user editable file. IOW. No, we won't work harder to deal with bad UTF-8 data in that file. And yes PTXprint does handle UTF-8 throughout. It's when people try to pass off non-UTF8 data as being UTF-8 that we have problems (however unaware they me be of doing so).

We would gladly convert unknown data to UTF-8 if we knew what were converting from and could sense it. In some cases we would be willing to do that, but since we own the .cfg file and we don't expect people to edit it, we don't include that file in such guessing. So it's up to you to keep that truly UTF-8.

We have seen all kinds of non-UTF8ness coming out of Paratext including having the whole SFM file on one line. That's why we run it through a canonicaliser first to clean it up.

davidc86 commented 3 years ago

Wow! Okay, who knew that the stuff I copies was NOT UTF-8? The editor was editing in UTF-8, so I assumed it was. Weird. Yeah, and I didn't even do it myself, I had the compare software refresh that line in the CFG file with that same line from the other CFG file! Now we know.

markpenny commented 3 years ago

Okay, I'm closing this one...