ulfgri / gdsii-toolbox

Octave and MATLAB toolbox for GDSII stream format
61 stars 20 forks source link

Create gdsii_ptext_fr.m #1

Closed ehud42 closed 8 years ago

ehud42 commented 9 years ago

Simplified function that will draw a path for text instead of boundary elements.

Would lie to add the ability to have multiple lines to the path.

ulfgri commented 9 years ago
Hi,

  I like the idea, but I don't like the implementation because:

  1) the name of the new function is perfectly non-intuitive
  2) it duplicates the 'gdsii_ptext' function - essentially all of
  it
  3) the help text is not updated

  How about writing a 'gdsii_text' function that has the option to
  render the text either as boundary elements or as path elements.
  'gdsii_ptext' then simply becomes a wrapper for 'gdsii_text' for
  backwards compatibility. Give me a day and I'll push a draft.

  Ulf

  On 05/05/2015 11:38 AM, ehud42 wrote:

    ehud42 wants to merge 1 commit into
    ulfgri:master from ehud42:master:

  Simplified function that will draw a path for text instead of
    boundary elements. 
  Would lie to add the ability to have multiple lines to the
    path.

  You can view, comment on, or merge this pull request online
    at:
    https://github.com/ulfgri/gdsii-toolbox/pull/1
  Commit Summary

    Create gdsii_ptext_fr.m

  File Changes

     A Elements/gdsii_ptext_fr.m
      (382) 

  Patch Links:

    https://github.com/ulfgri/gdsii-toolbox/pull/1.patch
    https://github.com/ulfgri/gdsii-toolbox/pull/1.diff

  —
    Reply to this email directly or view it
      on GitHub.

-- 

Ulf Griesmann \ tel: +1 301 339 4962 16833 Westbourne Terrace \ Gaithersburg, MD 20878-2033 \ e-mail: ulfgri@gmail.com

ehud42 commented 9 years ago

Okay.

My version was a hack to get a function that I wanted. I thought it might be useful to others.

Thanks for all of your work.

ulfgri commented 9 years ago
I pushed a function
  'Elements/gdsii_text.m'. It is still work in progress (!), but you
  can see where this is going. I realized that it isn't enough to
  just
  render the existing font with path elements. It makes much more
  sense to use a single stroke font for the paths, and I have
  decided to use one of the 
  Hershey fonts (http://en.wikipedia.org/wiki/Hershey_font) -
  probably 'rowmans', which looks pleasant. Requires more work to
  put it all together but the result should be quite nice.

  Ulf 

  On 05/05/2015 09:06 PM, ehud42 wrote:

  Okay. 
  My version was a hack to get a function that I wanted. I
    thought it might be useful to others.
  Thanks for all of your work.
  —
    Reply to this email directly or view
      it on GitHub.

-- 

Ulf Griesmann \ tel: +1 301 339 4962 16833 Westbourne Terrace \ Gaithersburg, MD 20878-2033 \ e-mail: ulfgri@gmail.com

ehud42 commented 9 years ago

I went through and tested this function today. I got an error when using it.

Top(end+1)=gdsii_text('sometext','path',[2500,100],100);

Gave this error

warning: path_glyph_table: some elements in list of return values are undefined error: gdsii_text: A(I): index out of bounds; value 115 out of bound 0 error: called from: error: gdsii-toolbox/Elements/gdsii_text.m at line 125, column 13

Second comment.

Why did you choose the order of input variables that you did?
For me going in order of most important to least important optional varialbes. Layer pathwidth angle linetype dtype

I understand why angle would be higher than the pathwidth. I have never used the dytpe option in my code.

Thanks for your work.

ulfgri commented 9 years ago
  You get the error because the function is not ready. The font data
  for the path font are not there yet.

  It might be better to have two separate functions, one that makes
  text from boundaries, another that makes text from paths. Then the
  order of the input arguments would be more obvious. As it stands,
  the function has input arguments that are not needed for someone
  who wants to generate lettering with boundaries. To have those
  arguments near the front would be inconvenient. For someone
  wanting to use paths it's just the other way. Combining the two
  functions is beginning to look like bad design.

  I'll probably have some time on the weekend to finish it.

  Ulf

  On 05/09/2015 05:58 AM, ehud42 wrote:

  I went through and tested this function today. I got an error
    when using it.
  Top(end+1)=gdsii_text('sometext','path',[2500,100],100);
  Gave this error
  warning: path_glyph_table: some elements in list of return
    values are undefined
    error: gdsii_text: A(I): index out of bounds; value 115 out of
    bound 0
    error: called from:
    error: gdsii-toolbox/Elements/gdsii_text.m at line 125, column
    13
  Second comment.
  Why did you choose the order of input variables that you did?

    For me going in order of most important to least important
    optional varialbes.
    Layer
    pathwidth
    angle
    linetype
    dtype
  I understand why angle would be higher than the pathwidth. I
    have never used the dytpe option in my code.
  Thanks for your work.
  —
    Reply to this email directly or view
      it on GitHub.

-- 

Ulf Griesmann \ tel: +1 301 339 4962 16833 Westbourne Terrace \ Gaithersburg, MD 20878-2033 \ e-mail: ulfgri@gmail.com

ulfgri commented 9 years ago

% % a text string made from boundary elements %

clear all

% string containing all ASCII characters in font allchar = char([33:126]);

% draw the string with boundaries be = gdsii_boundarytext(allchar, [0,0], 1000);

% draw it with paths pe = gdsii_pathtext(allchar, [0,2000], 1000);

% put it in a library and write to a file write_gds_library( gds_library('CHARS.DB', gds_structure('CHARS', {be,pe})), '!text.gds');