FontLab Forum
2012-05-23, 23:40:55 *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to the FontLab forum, read how to use it! Update: Archives from old MSN forums are now available on our forum.
 
   Home   Help Search Calendar Downloads Tags Login Register  
Del.icio.us Digg FURL FaceBook Stumble Upon Reddit SlashDot

Pages: [1]
  Print  
Author Topic: Broken strings in Python macro  (Read 1573 times)
bodoni boy
Beta: FontLab Studio Mac
Hero Member
***

Karma: +0/-0
United States United States

Posts: 29



WWW Email
« on: 2011-04-29, 13:10:12 »

I just spent most of a day writing a Python script to put the license into an open font. The problem was that FL would break the script in the middle of a string and ignore the rest of the script. Two of the breaks were typos, the others looked fine. Evidently there must have been some invisible characters that caused the problem. I fixed them by retyping the entire word or phrase even in the case of the typos. Just fixing the typo didn't work. But why would this happen if they were in a triple quoted string?

And although everything I read said "\n" makes a new line, this isn't accurate. Only "\r" worked. Is this a bug or just a Mac thing?

Mac 10.5.8, Python 2.5.2, non-programmer still learning Python.

George

Logged
BobH
Sr. Member
****

Karma: +0/-0
United Kingdom United Kingdom

Posts: 18



« Reply #1 on: 2011-05-10, 09:52:03 »

> And although everything I read said "\n" makes a new line, this isn't accurate. Only "\r" worked. Is this a bug or just a Mac thing?

Not addressing your original question, but I've often wondered about the "correct" new-line convention in the 'name' table. I've come to the conclusion that one should code newlines that are relevant for the platformID of the string. That is, for platformID 1 strings, use Mac line ends (CR, though maybe Unix line end, LF, might be OK too); for platforID 3 use Windows line ends (CRLF). 

But I don't know what to recommend for Platform ID 0 or 2.

Bob
Logged
Tags:
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!