Windows multi-line text


    May 29 2008 | 9:28 am
    Hi,
    Has anyone successfully worked with multi-line text using jit.textfile and jit.gl.text2d in Windows? It seems to work well on a Mac but Windows is displaying multiple squares in the spaces where the line-breaks occur. Please see patch, thanks.
    {
    "boxes" : [ {
    "box" : {
    "maxclass" : "message",
    "text" : "read",
    "numinlets" : 2,
    "id" : "obj-10",
    "fontname" : "Arial",
    "numoutlets" : 1,
    "patching_rect" : [ 288.0, 108.0, 36.0, 16.0 ],
    "outlettype" : [ "" ],
    "fontsize" : 10.0
    }
    }
    , {
    "box" : {
    "maxclass" : "comment",
    "text" : "bang",
    "numinlets" : 1,
    "id" : "obj-7",
    "fontname" : "Arial",
    "numoutlets" : 0,
    "patching_rect" : [ 336.0, 108.0, 30.0, 17.0 ],
    "fontsize" : 9.0
    }
    }
    , {
    "box" : {
    "maxclass" : "button",
    "numinlets" : 1,
    "id" : "obj-50",
    "numoutlets" : 1,
    "patching_rect" : [ 348.0, 336.0, 20.0, 20.0 ],
    "outlettype" : [ "bang" ]
    }
    }
    , {
    "box" : {
    "maxclass" : "newobj",
    "text" : "loadbang",
    "numinlets" : 1,
    "id" : "obj-51",
    "fontname" : "Arial",
    "numoutlets" : 1,
    "patching_rect" : [ 348.0, 312.0, 53.0, 18.0 ],
    "outlettype" : [ "bang" ],
    "fontsize" : 10.0
    }
    }
    , {
    "box" : {
    "maxclass" : "toggle",
    "numinlets" : 1,
    "id" : "obj-11",
    "numoutlets" : 1,
    "patching_rect" : [ 348.0, 360.0, 20.0, 20.0 ],
    "outlettype" : [ "int" ]
    }
    }
    , {
    "box" : {
    "maxclass" : "newobj",
    "text" : "qmetro 20",
    "numinlets" : 2,
    "id" : "obj-93",
    "fontname" : "Arial",
    "numoutlets" : 1,
    "patching_rect" : [ 348.0, 383.0, 56.0, 18.0 ],
    "outlettype" : [ "bang" ],
    "fontsize" : 10.0
    }
    }
    , {
    "box" : {
    "maxclass" : "newobj",
    "text" : "t b erase",
    "numinlets" : 1,
    "id" : "obj-85",
    "fontname" : "Arial",
    "numoutlets" : 2,
    "patching_rect" : [ 348.0, 408.0, 47.0, 18.0 ],
    "outlettype" : [ "bang", "erase" ],
    "fontsize" : 10.0
    }
    }
    , {
    "box" : {
    "maxclass" : "newobj",
    "text" : "jit.gl.render multiline",
    "numinlets" : 1,
    "id" : "obj-92",
    "fontname" : "Arial",
    "numoutlets" : 2,
    "patching_rect" : [ 376.0, 444.0, 99.0, 18.0 ],
    "outlettype" : [ "bang", "" ],
    "fontsize" : 10.0
    }
    }
    , {
    "box" : {
    "maxclass" : "button",
    "numinlets" : 1,
    "id" : "obj-35",
    "numoutlets" : 1,
    "patching_rect" : [ 660.0, 264.0, 20.0, 20.0 ],
    "outlettype" : [ "bang" ]
    }
    }
    , {
    "box" : {
    "maxclass" : "newobj",
    "text" : "loadbang",
    "numinlets" : 1,
    "id" : "obj-36",
    "fontname" : "Arial",
    "numoutlets" : 1,
    "patching_rect" : [ 660.0, 240.0, 53.0, 18.0 ],
    "outlettype" : [ "bang" ],
    "fontsize" : 10.0
    }
    }
    , {
    "box" : {
    "maxclass" : "message",
    "text" : "55",
    "numinlets" : 2,
    "id" : "obj-23",
    "fontname" : "Arial",
    "numoutlets" : 1,
    "patching_rect" : [ 661.25, 288.0, 20.5, 15.0 ],
    "outlettype" : [ "" ],
    "fontsize" : 9.0
    }
    }
    , {
    "box" : {
    "maxclass" : "message",
    "text" : "1",
    "numinlets" : 2,
    "id" : "obj-22",
    "fontname" : "Arial",
    "numoutlets" : 1,
    "patching_rect" : [ 663.5, 288.0, 16.0, 15.0 ],
    "outlettype" : [ "" ],
    "fontsize" : 9.0
    }
    }
    , {
    "box" : {
    "maxclass" : "message",
    "text" : "align $1",
    "numinlets" : 2,
    "id" : "obj-43",
    "fontname" : "Arial",
    "numoutlets" : 1,
    "patching_rect" : [ 663.5, 324.0, 45.0, 16.0 ],
    "outlettype" : [ "" ],
    "fontsize" : 10.0
    }
    }
    , {
    "box" : {
    "maxclass" : "flonum",
    "numinlets" : 1,
    "id" : "obj-1",
    "fontname" : "Arial",
    "numoutlets" : 2,
    "patching_rect" : [ 569.0, 288.0, 48.0, 18.0 ],
    "outlettype" : [ "float", "bang" ],
    "fontsize" : 10.0,
    "triscale" : 0.9
    }
    }
    , {
    "box" : {
    "maxclass" : "newobj",
    "text" : "pak position 0. 0.",
    "numinlets" : 3,
    "id" : "obj-2",
    "fontname" : "Arial",
    "numoutlets" : 1,
    "patching_rect" : [ 504.0, 324.0, 84.0, 18.0 ],
    "outlettype" : [ "" ],
    "fontsize" : 10.0
    }
    }
    , {
    "box" : {
    "maxclass" : "newobj",
    "text" : "pak size 12",
    "numinlets" : 2,
    "id" : "obj-17",
    "fontname" : "Arial",
    "numoutlets" : 1,
    "patching_rect" : [ 600.0, 324.0, 59.0, 18.0 ],
    "outlettype" : [ "" ],
    "fontsize" : 10.0
    }
    }
    , {
    "box" : {
    "maxclass" : "newobj",
    "text" : "jit.window multiline @size 640 480",
    "numinlets" : 1,
    "id" : "obj-39",
    "fontname" : "Arial",
    "numoutlets" : 2,
    "patching_rect" : [ 504.0, 444.0, 164.0, 18.0 ],
    "outlettype" : [ "bang", "" ],
    "fontsize" : 10.0
    }
    }
    , {
    "box" : {
    "maxclass" : "button",
    "numinlets" : 1,
    "id" : "obj-45",
    "numoutlets" : 1,
    "patching_rect" : [ 324.0, 108.0, 15.0, 15.0 ],
    "outlettype" : [ "bang" ]
    }
    }
    , {
    "box" : {
    "maxclass" : "newobj",
    "text" : "jit.textfile @adapt 1",
    "numinlets" : 1,
    "id" : "obj-47",
    "fontname" : "Arial",
    "numoutlets" : 3,
    "patching_rect" : [ 323.5, 144.0, 115.0, 18.0 ],
    "outlettype" : [ "jit_matrix", "jit_matrix", "" ],
    "fontsize" : 10.0
    }
    }
    , {
    "box" : {
    "maxclass" : "newobj",
    "text" : "jit.gl.text2d multiline @blend_enable 1 @color 1. 1. 1. 1.",
    "numinlets" : 1,
    "id" : "obj-8",
    "fontname" : "Arial",
    "numoutlets" : 2,
    "patching_rect" : [ 504.0, 408.0, 258.0, 18.0 ],
    "outlettype" : [ "", "" ],
    "fontsize" : 10.0
    }
    }
    ],
    "lines" : [ {
    "patchline" : {
    "source" : [ "obj-45", 0 ],
    "destination" : [ "obj-47", 0 ],
    "hidden" : 0,
    "midpoints" : [ ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-35", 0 ],
    "destination" : [ "obj-22", 0 ],
    "hidden" : 0,
    "midpoints" : [ ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-35", 0 ],
    "destination" : [ "obj-23", 0 ],
    "hidden" : 0,
    "midpoints" : [ ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-36", 0 ],
    "destination" : [ "obj-35", 0 ],
    "hidden" : 0,
    "midpoints" : [ ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-1", 0 ],
    "destination" : [ "obj-2", 2 ],
    "hidden" : 0,
    "midpoints" : [ 578.5, 315.0, 578.5, 315.0 ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-50", 0 ],
    "destination" : [ "obj-11", 0 ],
    "hidden" : 0,
    "midpoints" : [ ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-51", 0 ],
    "destination" : [ "obj-50", 0 ],
    "hidden" : 0,
    "midpoints" : [ ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-11", 0 ],
    "destination" : [ "obj-93", 0 ],
    "hidden" : 0,
    "midpoints" : [ ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-85", 1 ],
    "destination" : [ "obj-92", 0 ],
    "hidden" : 0,
    "midpoints" : [ 385.5, 433.0, 385.5, 433.0 ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-85", 0 ],
    "destination" : [ "obj-92", 0 ],
    "hidden" : 0,
    "midpoints" : [ ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-93", 0 ],
    "destination" : [ "obj-85", 0 ],
    "hidden" : 0,
    "midpoints" : [ ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-22", 0 ],
    "destination" : [ "obj-43", 0 ],
    "hidden" : 0,
    "midpoints" : [ ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-23", 0 ],
    "destination" : [ "obj-17", 1 ],
    "hidden" : 0,
    "midpoints" : [ ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-2", 0 ],
    "destination" : [ "obj-8", 0 ],
    "hidden" : 0,
    "midpoints" : [ ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-43", 0 ],
    "destination" : [ "obj-8", 0 ],
    "hidden" : 0,
    "midpoints" : [ 673.0, 360.0, 513.5, 360.0 ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-17", 0 ],
    "destination" : [ "obj-8", 0 ],
    "hidden" : 0,
    "midpoints" : [ 609.5, 364.0, 513.5, 364.0 ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-10", 0 ],
    "destination" : [ "obj-47", 0 ],
    "hidden" : 0,
    "midpoints" : [ ]
    }
    }
    , {
    "patchline" : {
    "source" : [ "obj-47", 0 ],
    "destination" : [ "obj-8", 0 ],
    "hidden" : 0,
    "midpoints" : [ 333.0, 260.0, 481.0, 260.0, 481.0, 401.0, 513.5, 401.0 ]
    }
    }
    ]
    }

    • May 29 2008 | 8:15 pm
      Thanks, I can reproduce here, we will look into it.
      Also, as a note, when posting patches, please either send as a file attachment or use 'copy compressed'.
      -Ben
      Cycling '74
    • Jun 11 2013 | 8:26 pm
      bump...
      this happens to happen 5 years later ... with latest Max6.1.2
      Also, is there a precise way to get a text rendered without any "Äö√†√∂¬¨¬©r" when opening a patch made on OSX, on a windows platform (apart from avoiding all accents like é, è, ê, ë ...) ?
      FWIW, I used the code below to filter dirty characters out.
    • May 05 2015 | 6:25 pm
      did you find any solutions for that problem?
      Max 6.1.9, Mac 10.9.5
      cheers
    • May 06 2015 | 1:24 am
      found a way around.
      just replace all the 0s by 32 (ASCII code for space). The problem was that text2d doesn't know what to do with 0 value in the matrix.
      put a [jit.expr @expr in[0]+(in[0]==0)*.126] before the text2d