/***********************************************************************/ /* */ /* EanDesign - EAN13 barcode/code-barres generator */ /* pour InDesign CS/CS2/CS3 */ /* */ /* Version: 1.03b -- Auteur: Marc Autret -- Update: 27/09/07 */ /* Lang.: FR | EN Creat.: 28/06/07 */ /* */ /* Aide/help : http://marcautret.free.fr/geek/indd/eandesign/ */ /* */ /* Installation: */ /* */ /* 1) Placer le present fichier dans le sous-dossier */ /* Presets/Scripts/ de l'application InDesign */ /* (ou Scripts/Scripts Panel/ sous CS3) */ /* */ /* 2) Lancer InDesign, ouvrir ou creer un document */ /* */ /* 3) Si besoin, creer et selectionner un bloc quelconque */ /* en guise de gabarit (on peut aussi selectionner un */ /* code-barres precedemment genere afin de l'actualiser) */ /* */ /* 4) Executer le script par Fenetre>Automatisation>Scripts */ /* (ou Fenetre>Scripts>Scripts sous CS) */ /* suivi d'un double-clic sur EanDesign.js */ /* */ /* (ou affecter au script un raccourci-clavier via */ /* Edition>Raccourcis-clavier>Zone:"scripts") */ /* */ /* NB: Pour ajouter un nouveau style de chiffre, */ /* cf. http://marcautret.free.fr/geek/indd/eandesign/ */ /* */ /* NB: requiert InDesign CS ou CS2 ou CS3 */ /* */ /* Bugs & Feedback : marcautret@free.fr */ /* */ /***********************************************************************/ //-------------------------------------------------------------------- // CONSTANTS //-------------------------------------------------------------------- var ENUM_LOCAL_FRENCH = 1279477362; // = Locale.frenchLocale var BLACK_SWATCH = "Black"; var NONE_SWATCH = "None"; //-------------------------------------------------------------------- // GLOBAL SETTINGS & PREFERENCES //-------------------------------------------------------------------- var SCRIPT_NAME = "EanDesign"; var SCRIPT_VERSION = "1.03b"; var LANG = (app.locale == ENUM_LOCAL_FRENCH) ? 1 : 0; // ENGLISH: 0 | FRANCAIS: 1 //---------------------------------------------------------- // COMPATIBILITY // 1.03b //---------------------------------------------------------- var APP_INT_VERSION = parseInt(app.version); switch(APP_INT_VERSION) { case 3 : // CS break; default : // CS2... app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; break; } //-------------------------------------------------------------------- // LINGUISTICS //-------------------------------------------------------------------- var ERR_NO_DOCUMENT = [ "Please open or create a document before running " + SCRIPT_NAME, "Veuillez ouvrir ou créer un document avant de lancer " + SCRIPT_NAME ]; var DLG_EAN_13 = [ "EAN-13 (or ISBN-13) : ", "EAN-13 (ou ISBN-13) : " ]; var DLG_UPDATE_BC = [ " Update the barcode", " Mettre à jour le code-barres" ]; var DLG_REMOVE_PAT = [ " Remove the pattern", " Supprimer le gabarit" ]; var DLG_CREATE_BC = [ " Create a new one", " Création d'un nouveau code-barres" ]; var DLG_KEEP_PAT = [ " Keep the pattern", " Conserver le gabarit" ]; var DLG_DIM_PANEL = [ "Dimensions", "Dimensions" ]; var DLG_GRID_SPACE = [ " Internal dimensions (without considering digits block)", " Dimensions internes (sans compter le bloc-chiffres)" ]; var DLG_DIMS = [ [ "Width : ", "Largeur : " ], [ " × Height : ", " × Hauteur : " ] ]; var DLG_BAR_OFFSET = [ "Bars height : ", "Hauteur des barres : " ]; var DLG_DIG_PANEL = [ "Digits Style", "Style de chiffres" ]; var DLG_DIG_OFFSET = [ "Digits spacing : ", "Espacement des chiffres : " ]; var DLG_VSTRETCH = [ " Enable vertical stretch", " Autoriser l'étirement vertical" ]; var DLG_OUT_OF_RANGE = [ "Out of range dimensions !", "Dimensions hors limites !" ]; var DLG_OPTIMIZE_RATIO = [ "The \"Height\" dimension is out of proportion !\r\rAuto-resize to optimal ratio ?", "La hauteur est disproportionnée !\r\rRéajuster automatiquement au ratio optimal ?" ]; var DLG_BAD_CODE = [ "Please enter a valid code !\r(It must contain 12 or 13 digits.)", "Veuillez saisir un code valide !\r(Celui-ci doit contenir 12 ou 13 chiffres.)" ]; var DLG_FIXED_CHECKSUM = [ "Incorrect checksum !\r\rThe EAN-13 has been fixed to :\r", "Somme de contrôle incorrecte !\r\rLe code EAN-13 a été corrigé ainsi :\r" ]; var DLG_SCAN_FONT_OK = [ "The current font digits have been \"serialized\" in the clipboard.\r\rPaste the code in the script to create a \"TDigFont._setFontXXX\" method.", "Les chiffres de la police courante ont été \"sérialisés\" dans le presse-papier.\r\rCollez le code dans le script pour créer une nouvelle métode \"TDigFont._setFontXXX\".", ]; var DLG_SCAN_FONT_CF = [ "Do you want to \"serialize\" digits (based on the selected textframe font) to the clipboard ?", "Voulez-vous que les chiffres basés sur la police courante soient \"sérialisés\" dans le presse-papier ?" ]; //-------------------------------------------------------------------- // CLASS TDigFont //-------------------------------------------------------------------- /*obj */ function TDigFont() //-------------------------------------------------------------------- // CONSTRUCTEUR { this._pathFont = null; this._maxWidth = null; this._fontName = null; this._fontIndex = null; this.setFont(); } /*void*/ TDigFont.scanFontToClipboard = function(/*obj*/doc,/*obj*/tFrame) // STATIC //-------------------------------------------------------------------- // Utilitaire de "serialisation" d'une police // Le code serialise est copie dans le clipboard { var shape = null; var iPaths = null; var h = null; var i = null; var p = null; var maxW = 0; var w = null; var digsCode = "/*void */\tTDigFont.prototype._setFontXXX = function()\n" + "//--------------------------------------------------------------------\n" + "{\nthis._pathFont =\n[\n"; for ( i=0 ; i<=9 ; i++ ) // scan des chiffres [0-9] { tFrame.contents = '' + i; // !! createOutlines() renvoie un Array de polygons !! // !! avec apparemment 1 seul item dans tous les cas !! shape = tFrame.createOutlines(false)[0]; // placer la forme en [0,0] avec hauteur=1 h = shape.geometricBounds[2]-shape.geometricBounds[0]; w = (shape.geometricBounds[3]-shape.geometricBounds[1])/h; maxW = Math.max(w,maxW); shape.geometricBounds = [0,0,1,w]; // recuperer les paths de la forme i dans un meta-tableau iPaths = []; for(p=shape.paths.length-1 ; p>=0 ; p--) iPaths.unshift(shape.paths[p].entirePath); // nettoyer shape.remove(); shape=null; // formater le code a la volee digsCode += ( "/*" + i + "*/" + "\t" + iPaths.toSource() + ",\n" ); } digsCode = digsCode.substring(0,digsCode.length-2) + "\n\];\n" + "this._maxWidth = " + maxW + ";\n\}\n"; // Copier le code dans le presse-papier var tf = doc.textFrames.add(); tf.parentStory.contents = digsCode; tf.parentStory.texts[0].select(); app.copy(); tf.remove(); } /*arr */ TDigFont.getFontList = function() // STATIC //-------------------------------------------------------------------- // Renvoie la liste des fontes disponibles // !! Pour chaque item XXX de la liste, la methode _setFontXXX() doit exister !! { return(["OCR","Myriad","Arial","CenturyGoth"]); } /*void */ TDigFont.prototype.setFont = function(/*var*/ _font) //-------------------------------------------------------------------- // Active la font nommee _font (string) ou d'index _font { var f = (_font) ? _font : 0; var fList = TDigFont.getFontList(); if ( f.constructor.name == "String" ) { var i=null; for(i=fList.length-1 ; i>=0 ; i--) { if (fList[i] == f) { this._fontName = f; this._fontIndex = i; break; } } } else { if ( f < fList.length ) { this._fontName = fList[f]; this._fontIndex = f; } } try { this["_setFont" + this._fontName](); } catch(ex) {} } /*str */ TDigFont.prototype.getFontName = function() //-------------------------------------------------------------------- // Renvoie le nom de la fonte active { return(this._fontName); } /*int */ TDigFont.prototype.getFontIndex = function() //-------------------------------------------------------------------- // Renvoie l'index [dans ::getFontList()] de la fonte active { return(this._fontIndex); } /*void */ TDigFont.prototype._setFontOCR = function() //-------------------------------------------------------------------- { this._pathFont = [ /*0*/ [[[[0.45333333333333,-2.00530949870073e-14],[0.32400024220406,-2.00530949870073e-14],[0.19333357553739,-2.00530949870073e-14]],[[0.088,0.0146669088707],[0.04266666666667,0.14666666666664],[0.00666690887073,0.25200024220404]],[[0,0.37599999999997],[0,0.48666690887072],[0,0.60533333333331]],[[0.00666690887073,0.85599999999997],[0.09466690887072,0.94133333333331],[0.14400000000001,0.98933333333331]],[[0.24666690887072,0.99999999999999],[0.32400024220406,0.99999999999999],[0.39999999999999,0.99999999999999]],[[0.50266690887073,0.98800024220404],[0.55199999999999,0.94133333333331],[0.64000000000001,0.8546669088707]],[[0.648,0.60533333333331],[0.648,0.48666690887072],[0.648,0.37599999999997]],[[0.64133357553739,0.25200024220404],[0.60533333333333,0.14666666666664],[0.56,0.0146669088707]]],[[[0.21733357553738,0.12533333333331],[0.32400024220406,0.12533333333331],[0.43066690887071,0.12533333333331]],[[0.47866690887073,0.12933357553739],[0.496,0.23199999999998],[0.50800024220405,0.30533357553738]],[[0.51066690887072,0.42533357553737],[0.51066690887072,0.5013333333333],[0.51066690887072,0.57200024220403]],[[0.50666666666666,0.78800024220405],[0.46933333333333,0.83866690887071],[0.44400024220405,0.87333357553736]],[[0.36933357553738,0.87466666666666],[0.32400024220406,0.87466666666666],[0.27866690887071,0.87466666666666]],[[0.20400024220405,0.87333357553736],[0.17866666666667,0.83866690887071],[0.14000024220405,0.78800024220405]],[[0.13733357553738,0.57200024220403],[0.13733357553738,0.5013333333333],[0.13733357553738,0.42533357553737]],[[0.13866666666666,0.30533357553738],[0.152,0.23199999999998],[0.16933357553739,0.12933357553739]]]], /*1*/ [[[0.25412062959747,0.15934065934065],[0.25412062959747,0.99999999999999],[0.39560439560439,0.99999999999999],[0.39560439560439,-2.00530949870073e-14],[0.24313161860845,-2.00530949870073e-14],[0,0.20329670329667],[0,0.37912087912087]]], /*2*/ [[[0.13900107030634,0.87314443055831],[[0.13900107030634,0.85290127539528],[0.13900107030634,0.85290127539528],[0.13900107030634,0.73954097929841]],[[0.24561397487647,0.65856933922925],[0.33333300647234,0.60188919118084],[0.46558668525199,0.51551944177371]],[[0.59514130936265,0.44804307504941],[0.59514130936265,0.26990546689724],[0.59514130936265,0.08906880407611]],[[0.45209141190711,2.00530949870073e-14],[0.28340074024209,2.00530949870073e-14],[0.19433193616601,2.00530949870073e-14]],[[0.09041808626483,0.02699054668973],[0.01754361020258,0.0823214125494],[0.01754361020258,0.0823214125494]],[[0.01754361020258,0.2321187015316],[0.01754361020258,0.2321187015316],[0.09311714093379,0.17678832596345]],[[0.2091764916996,0.1268555694417],[0.30499317759387,0.1268555694417],[0.38326576299407,0.1268555694417]],[[0.45614023905632,0.19568170864622],[0.45614023905632,0.27530357623516],[0.45614023905632,0.37246954431818]],[[0.34682827981719,0.43454780170456],[0.27395380375494,0.48043173107708],[0.08501997692688,0.60053990899209]],[[0,0.69365704992588],[0,0.9257757514575],[0,0.9257757514575]],[0,0.99999999999999],[0.58299580849802,0.99999999999999],[0.58299580849802,0.87314443055831]]], /*3*/ [[[0.5970150725232,-2.00530949870073e-14],[0,-2.00530949870073e-14],[0,0.12754412912994],[0.41926764968016,0.12754412912994],[0.16553599738143,0.38670269822615],[0.16553599738143,0.49389428726918],[[0.27408419238565,0.49389428726918],[0.27408419238565,0.49389428726918],[0.3934872068903,0.49389428726918]],[[0.49660799214429,0.54409758098227],[0.49660799214429,0.67571251390128],[0.49660799214429,0.81818177336794]],[[0.37720497763965,0.87245587087004],[0.2523745533848,0.87245587087004],[0.16282229250632,0.87245587087004]],[[0.07734083541687,0.85210333078311],[0,0.80189954411731],[0,0.80189954411731]],[[0,0.9416555916616],[0,0.9416555916616],[0.0827682451671,0.97693375503798]],[[0.16417939142025,0.99999999999999],[0.25508825825991,0.99999999999999],[0.45318871414262,0.99999999999999]],[[0.6363640396886,0.89959291962111],[0.6363640396886,0.67978282473754],[0.6363640396886,0.50474910676963]],[[0.51831763114514,0.39484381285146],[0.34871132292741,0.38670269822615],[0.34871132292741,0.38670269822615]],[0.5970150725232,0.13839894863038]]], /*4*/ [[[0.52060414608099,0.65109890109888],[0.52060414608099,0.44505494505491],[0.37912087912089,0.44505494505491],[0.37912087912089,0.65109890109888],[0.13736263736264,0.65109890109888],[0.43956043956045,-2.00530949870073e-14],[0.29395604395606,-2.00530949870073e-14],[0,0.63186813186812],[0,0.78021978021978],[0.37912087912089,0.78021978021978],[0.37912087912089,0.99999999999999],[0.52060414608099,0.99999999999999],[0.52060414608099,0.78021978021978],[0.64285714285716,0.78021978021978],[0.64285714285716,0.65109890109888]]], /*5*/ [[[0.15332457191982,0.12754412912994],[0.52781584468438,0.12754412912994],[0.52781584468438,-2.00530949870073e-14],[0.02985075362616,-2.00530949870073e-14],[0,0.45861612389284],[[0.16824970225654,0.44640420547847],[0.16824970225654,0.44640420547847],[0.24830424254853,0.44097679572825]],[[0.41519684589112,0.45861612389284],[0.41519684589112,0.63364984186075],[0.41519684589112,0.82089547824303]],[[0.23880602900927,0.87245587087004],[0.08005454029199,0.87245587087004],[0.08005454029199,0.87245587087004]],[0,0.87245587087004],[0,0.99999999999999],[[0.04613298287679,0.99999999999999],[0.04613298287679,0.99999999999999],[0.16824970225654,0.99999999999999]],[[0.55495289343543,0.96879264041267],[0.55495289343543,0.63500694077467],[0.55495289343543,0.40705573126583]],[[0.37313466680337,0.31886007634851],[0.16960680117047,0.31886007634851],[0.16960680117047,0.31886007634851]],[0.1370423426692,0.31886007634851]]], /*6*/ [[[0.38670269822617,-2.00530949870073e-14],[[0.13839894863038,0.28629561784726],[0.13839894863038,0.28629561784726],[0.04206217908777,0.39755751772659]],[[0,0.5142468273561],[0,0.66350059548691],[0,0.87381296978396]],[[0.12075962046583,0.99999999999999],[0.33242860072405,0.99999999999999],[0.52238794198144,0.99999999999999]],[[0.66214398952574,0.87245587087004],[0.66214398952574,0.67706911986244],[0.66214398952574,0.50474910676963]],[[0.53867017123206,0.35278163376373],[0.35956564947512,0.35278163376373],[0.31478976551224,0.35278163376373]],[[0.27408419238565,0.36092274838904],[0.23473522522025,0.37856158360083],[0.23473522522025,0.37856158360083]],[0.23337861925907,0.37584787872574],[[0.29850753626161,0.29036642163628],[0.29850753626161,0.29036642163628],[0.37313417385063,0.19131594721855]],[[0.46811384447934,0.08683855600337],[0.56173690914684,-2.00530949870073e-14],[0.56173690914684,-2.00530949870073e-14]]],[[[0.21845299596963,0.48032576289369],[0.32835828988777,0.48032576289369],[0.44097679572827,0.48032576289369]],[[0.52238794198144,0.55902320427173],[0.52238794198144,0.67435541498735],[0.52238794198144,0.79375842949196]],[[0.4450475995173,0.87245587087004],[0.33107199476288,0.87245587087004],[0.21438268513333,0.87245587087004]],[[0.13975555459157,0.7896881186557],[0.13975555459157,0.67299880902615],[0.13975555459157,0.56309351510802]]]], /*7*/ [[[[0.48901098901099,0.12912087912088],[0.48901098901099,0.12912087912088],[0.48489035941353,0.16483516483516]],[[0.45879120879122,0.19505494505493],[0.43406593406594,0.22252747252747],[0.43406593406594,0.22252747252747]],[[0.38461538461539,0.28021978021977],[0.38461538461539,0.28021978021977],[0.2445054945055,0.44505494505491]],[[0.14285714285715,0.61813186813183],[0.14285714285715,0.83928546476228],[0.14285714285715,0.83928546476228]],[0.14285714285715,0.99999999999999],[0.28434090886407,0.99999999999999],[[0.28434090886407,0.83928546476228],[0.28434090886407,0.83928546476228],[0.28434090886407,0.60439560439559]],[[0.38324200776516,0.48488986036669],[0.52884640336957,0.31318681318682],[0.55906618358934,0.27609865157549]],[[0.61126398578716,0.21291183838868],[0.63186813186814,0.17032967032967],[0.65659340659341,0.11813186813187]],[[0.65796728249045,0.07417582417581],[0.65796728249045,0.0164835164835],[0.65796728249045,0.0164835164835]],[0.65796728249045,-2.00530949870073e-14],[0,-2.00530949870073e-14],[0,0.12912087912088]]], /*8*/ [[[[0.41599999999999,0.87466666666666],[0.32400024220406,0.87466666666666],[0.232,0.87466666666666]],[[0.13733357553738,0.8293333333333],[0.13733357553738,0.71866690887073],[0.13733357553738,0.61333333333332]],[[0.22800024220405,0.56533333333332],[0.32400024220406,0.51333357553739],[0.41866666666667,0.56533333333332]],[[0.51066690887072,0.61333333333332],[0.51066690887072,0.71866690887073],[0.51066690887072,0.8293333333333]]],[[[0.46000024220405,-2.00530949870073e-14],[0.32400024220406,-2.00530949870073e-14],[0.18800024220406,-2.00530949870073e-14]],[[0.03733333333333,0.06000024220406],[0.03733333333333,0.21466690887069],[0.03733333333333,0.32666690887071]],[[0.11866690887072,0.39066690887069],[0.20266666666667,0.44533333333333],[0.08266666666666,0.50399999999997]],[[0,0.58666666666665],[0,0.73066666666664],[0,0.928]],[[0.14666666666666,0.99999999999999],[0.32400024220406,0.99999999999999],[0.50000024220406,0.99999999999999]],[[0.648,0.928],[0.648,0.73066666666664],[0.648,0.58666666666665]],[[0.56533333333332,0.50399999999997],[0.44400024220405,0.44533333333333],[0.52933357553739,0.39066690887069]],[[0.61066666666667,0.32666690887071],[0.61066666666667,0.21466690887069],[0.61066666666667,0.06000024220406]]],[[[0.25866666666667,0.12533333333331],[0.32400024220406,0.12533333333331],[0.38933333333333,0.12533333333331]],[[0.47333357553739,0.14533357553737],[0.47333357553739,0.22666666666664],[0.47333357553739,0.30266690887071]],[[0.384,0.35466666666664],[0.32400024220406,0.37866666666664],[0.264,0.35466666666664]],[[0.17466690887073,0.30266690887071],[0.17466690887073,0.22666666666664],[0.17466690887073,0.14533357553737]]]], /*9*/ [[[[0.27665285842393,0.99999999999999],[0.27665285842393,0.99999999999999],[0.44534402038045,0.82186239184782]],[[0.66261767608698,0.58704463564724],[0.66261767608698,0.34682877010869],[0.66261767608698,0.14035084278655]],[[0.54250998846344,2.00530949870073e-14],[0.33468277895258,2.00530949870073e-14],[0.13495273344863,2.00530949870073e-14]],[[0,0.12955462411066],[0,0.32928466961461],[0,0.50742227776678]],[[0.12955462411068,0.6450740658844],[0.30769223226285,0.6450740658844],[0.34817805229743,0.6450740658844]],[[0.39001315452076,0.63562761968872],[0.42240181054843,0.61943329167491],[0.42240181054843,0.61943329167491]],[0.42510086521741,0.62213234634387],[[0.42645063769763,0.62078257386365],[0.42645063769763,0.62078257386365],[0.33468277895258,0.76113341665019]],[[0.21322531884882,0.88259087675394],[0.09176785874507,0.99999999999999],[0.09176785874507,0.99999999999999]]],[[[0.21052626417984,0.1268555694417],[0.33468277895258,0.1268555694417],[0.44939235723815,0.1268555694417]],[[0.52361660578064,0.20647792732211],[0.52361660578064,0.32253727808795],[0.52361660578064,0.43589757418477]],[[0.44669330256919,0.51821849644268],[0.33468277895258,0.51821849644268],[0.21997271037551,0.51821849644268]],[[0.13900107030634,0.43994591104248],[0.13900107030634,0.32523633275691],[0.13900107030634,0.19973004550397]]]] ]; this._maxWidth = 0.66261767608696; } /*void */ TDigFont.prototype._setFontMyriad = function() //-------------------------------------------------------------------- { this._pathFont = [ /*0*/ [[[[0.54017830111155,-2.00530949870073e-14],[0.33630952380953,-2.00530949870073e-14],[0.13988095238094,-2.00530949870073e-14]],[[0,0.17857142857141],[0,0.50297619047618],[0.00297619047619,0.82291693698368]],[[0.13095238095237,0.99999999999999],[0.31994020587344,0.99999999999999],[0.53422592015917,0.99999999999999]],[[0.65624972968297,0.81845238095238],[0.65624972968297,0.48958360365035],[0.65624972968297,0.1815476190476]]],[[[0.21428571428571,0.10119047619047],[0.32886877730201,0.10119047619047],[0.46428571428571,0.10119047619047]],[[0.5252973487306,0.2574407465075],[0.5252973487306,0.49553598460273],[0.5252973487306,0.74255979412656]],[[0.46130952380952,0.8988095238095],[0.32738095238094,0.8988095238095],[0.20833333333333,0.8988095238095]],[[0.13095238095237,0.75595238095239],[0.13095238095237,0.5044645560313],[0.13095238095237,0.24107142857143]]]], /*1*/ [[[0.20307692307692,0.99999999999999],[0.33384587437992,0.99999999999999],[0.33384587437992,2.00530949870073e-14],[0.21846153846153,2.00530949870073e-14],[0,0.11692307692307],[0.02615356668763,0.2199997205338],[0.19999999999999,0.12615384615386],[0.20307692307692,0.12615384615386]]], /*2*/ [[[0.62783671347139,0.99999999999999],[0.62783671347139,0.88956102633668],[0.18608191807971,0.88956102633668],[0.18608191807971,0.88653530856001],[[0.26475058027275,0.81391808192027],[0.26475058027275,0.81391808192027],[0.47201197315822,0.61422070866104]],[[0.60363097125815,0.46747367130869],[0.60363097125815,0.28593060470936],[0.60363097125815,0.14523445327947]],[[0.51437202203139,2.00530949870073e-14],[0.30257177766553,2.00530949870073e-14],[0.18910763585638,2.00530949870073e-14]],[[0.09228466700339,0.04236004887319],[0.02420574221324,0.09984868662963],[0.02420574221324,0.09984868662963]],[[0.06656579108641,0.19364593770595],[0.06656579108641,0.19364593770595],[0.11195155773623,0.15582474031317]],[[0.18608191807971,0.11043897366337],[0.27534031767562,0.11043897366337],[0.42208790465882,0.11043897366337]],[[0.47049938908532,0.20272309103591],[0.47049938908532,0.30257177766553],[0.46898625538157,0.45083194872165]],[[0.35552211357242,0.57791209534117],[0.10438753811001,0.81694379969694],[0.10438753811001,0.81694379969694]],[0,0.91830562003032],[0,0.99999999999999]]], /*3*/ [[[[0,0.93452380952382],[0,0.93452380952382],[0.04761904761904,0.96577407984083]],[[0.14285714285715,0.99999999999999],[0.25148782492107,0.99999999999999],[0.48363068206392,0.99999999999999]],[[0.60416666666667,0.86458360365034],[0.60416666666667,0.70982169888843],[0.60416666666667,0.57440476190477]],[[0.50744020587344,0.48511904761904],[0.38839258682583,0.46130952380952],[0.38839258682583,0.46130952380952]],[[0.38839258682583,0.45833333333333],[0.38839258682583,0.45833333333333],[0.50744020587344,0.4151788417456]],[[0.56696401539725,0.33035714285713],[0.56696401539725,0.23065503222179],[0.56696401539725,0.11309523809523]],[[0.48065449158773,-2.00530949870073e-14],[0.29017830111154,-2.00530949870073e-14],[0.18601163444488,-2.00530949870073e-14]],[[0.0877973487306,0.03720265126942],[0.03720211063535,0.07440476190477],[0.03720211063535,0.07440476190477]],[[0.07142857142858,0.16964285714284],[0.07142857142858,0.16964285714284],[0.11309523809523,0.13988095238094]],[[0.1875,0.10565503222178],[0.26488095238095,0.10565503222178],[0.38541639634964,0.10565503222178]],[[0.43452380952381,0.17410741317415],[0.43452380952381,0.25148836555512],[0.43452380952381,0.36607142857141]],[[0.31398782492106,0.4151788417456],[0.21874972968297,0.4151788417456],[0.21874972968297,0.4151788417456]],[0.14583333333334,0.4151788417456],[0.14583333333334,0.51339312745986],[[0.21874972968297,0.51339312745986],[0.21874972968297,0.51339312745986],[0.3452380952381,0.51339312745986]],[[0.4672619047619,0.57142857142858],[0.46874972968297,0.70684550841224],[0.47023809523809,0.78720265126941]],[[0.41815449158772,0.89434550841224],[0.25,0.89434550841224],[0.15922592015917,0.89434550841224]],[[0.07291639634965,0.85714285714284],[0.03571428571428,0.83333333333332],[0.03571428571428,0.83333333333332]]]], /*4*/ [[[0.59230797177391,0.99999999999999],[0.59230797177391,0.72769202822608],[0.73230769230769,0.72769202822608],[0.73230769230769,0.62153846153845],[0.59230797177391,0.62153846153845],[0.59230797177391,2.00530949870073e-14],[0.44615384615384,2.00530949870073e-14],[0,0.63846125899533],[0,0.72769202822608],[0.46461538461538,0.72769202822608],[0.46461538461538,0.99999999999999]],[[0.13692335638929,0.62153846153845],[0.13692335638929,0.61846153846154],[[0.38153846153845,0.27846125899532],[0.38153846153845,0.27846125899532],[0.40923076923076,0.23230741284149]],[[0.43384615384615,0.18923048976456],[0.46461538461538,0.130768951303],[0.46461538461538,0.130768951303]],[[0.46923104869698,0.130768951303],[0.46923104869698,0.130768951303],[0.46615412562006,0.18307664361072]],[[0.46461538461538,0.23538433591839],[0.46461538461538,0.28769202822611],[0.46461538461538,0.28769202822611]],[0.46461538461538,0.62153846153845]]], /*5*/ [[[0.59152787564266,-2.00530949870073e-14],[0.12102877758737,-2.00530949870073e-14],[[0.057488669354,0.47201223259068],[0.057488669354,0.47201223259068],[0.09379730263021,0.4674733786156]],[[0.13766995969005,0.46142193973621],[0.19364604413977,0.46142193973621],[0.39031780771924,0.46142193973621]],[[0.47503795203039,0.55219352292675],[0.47655053693468,0.67927373939349],[0.47655053693468,0.8108928098353]],[[0.36913777164145,0.89258723470675],[0.243570140079,0.89258723470675],[0.15431169142389,0.89258723470675]],[[0.07412985145669,0.86233004030994],[0.03328291383652,0.83812428479244],[0.03328291383652,0.83812428479244]],[[0,0.9394856112063],[0,0.9394856112063],[0.04689837649953,0.96974280560315]],[[0.13766995969005,0.99999999999999],[0.24508327461441,0.99999999999999],[0.45839622029656,0.99999999999999]],[[0.61119532681619,0.85627860143055],[0.61119532681619,0.66414514219504],[0.61119532681619,0.54009064516802]],[[0.54765521858282,0.45537050085687],[0.47049909805529,0.41149784379699],[0.40998470926162,0.37518921052079]],[[0.33434172326952,0.35854747878698],[0.25869873727742,0.35854747878698],[0.22239010400121,0.35854747878698]],[[0.20121006792342,0.36157319822665],[0.17851744694137,0.36459891766633],[0.17851744694137,0.36459891766633]],[0.21633866512184,0.11195161926827],[0.59152787564266,0.11195161926827]]], /*6*/ [[[[0.56929970702685,-2.00530949870073e-14],[0.56929970702685,-2.00530949870073e-14],[0.54545469311996,-2.00530949870073e-14]],[[0.512667798998,0.00149004264921],[0.47391965139931,0.00745129612592],[0.35171395512653,0.02235442981773]],[[0.24441139254556,0.07153504172065],[0.16393447060982,0.15052137956726],[0.06855441498228,0.24590143519478]],[[0,0.39642335620196],[0,0.587183467457],[0,0.8390461561285]],[[0.13561824587544,0.99999999999999],[0.34277207491146,0.99999999999999],[0.54396410903083,0.99999999999999]],[[0.6646797626544,0.83606552939017],[0.6646797626544,0.65871850917767],[0.6646797626544,0.46944844057183]],[[0.54396410903083,0.34575270164981],[0.37257834229505,0.34575270164981],[0.26527577971408,0.34575270164981]],[[0.18479885777834,0.39642335620196],[0.13859887261379,0.45752593361838],[0.13859887261379,0.45752593361838]],[[0.13412820322623,0.45752593361838],[0.13412820322623,0.45752593361838],[0.15648263304396,0.29806267383603]],[[0.26527577971408,0.14754075282889],[0.47093902466096,0.11326381605769],[0.50819658817051,0.10730256258099]],[[0.54247406638161,0.10581197849185],[0.56929970702685,0.10730256258099],[0.56929970702685,0.10730256258099]]],[[[0.34277207491146,0.89865869089573],[0.34277207491146,0.89865869089573],[0.20566324494688,0.89865869089573]],[[0.13263761913707,0.78092420545045],[0.12965699239872,0.6214604042282],[0.12965699239872,0.59761539032131]],[[0.13561824587544,0.57824158724193],[0.14456012609052,0.56333845355011],[0.18032764695085,0.49329345447872]],[[0.25335327276064,0.4441133840157],[0.33233961060723,0.4441133840157],[0.45305526423079,0.4441133840157]],[[0.53204160207738,0.52757093268982],[0.53204160207738,0.66616980530361],[0.53204160207738,0.80476921935735]],[[0.45603589096915,0.89865869089573],[0.34426211756067,0.89865869089573],[0.34426211756067,0.89865869089573]]]], /*7*/ [[[0,2.00530949870073e-14],[0,0.11230741284146],[0.48923076923077,0.11230741284146],[0.48923076923077,0.11538433591841],[0.0553846153846,0.99999999999999],[0.19538489485083,0.99999999999999],[0.63076923076922,0.08923076923078],[0.63076923076922,2.00530949870073e-14]]], /*8*/ [[[[0.19196455603133,0.47916666666666],[0.19196455603133,0.47916666666666],[0.07291693698369,0.52976190476188]],[[0,0.61607142857143],[0,0.73809523809521],[0,0.87946455603129]],[[0.12202380952382,0.99999999999999],[0.32440476190477,0.99999999999999],[0.50892857142858,0.99999999999999]],[[0.65327407984085,0.88690476190474],[0.65327407984085,0.718750270317],[0.65327407984085,0.60119047619048]],[[0.57886931793608,0.51636931793605],[0.45833333333335,0.46875027031702],[0.45833333333335,0.46875027031702]],[[0.45833333333335,0.46428571428571],[0.45833333333335,0.46428571428571],[0.57738095238096,0.4077380952381]],[[0.61755979412657,0.31994074650749],[0.61755979412657,0.23809523809524],[0.61755979412657,0.11755979412654]],[[0.52380952380953,-2.00530949870073e-14],[0.33630952380953,-2.00530949870073e-14],[0.16666666666667,-2.00530949870073e-14]],[[0.03720265126942,0.10416666666666],[0.03720265126942,0.2574407465075],[0.03720265126942,0.34077407984082]],[[0.08333333333333,0.42410741317417],[0.19047619047621,0.4747026512694],[0.19047619047621,0.4747026512694]]],[[[0.44494074650752,0.90476190476188],[0.32738095238096,0.90476190476188],[0.20386931793609,0.90476190476188]],[[0.12946455603132,0.81845238095238],[0.13392857142858,0.72023809523807],[0.13392857142858,0.62797619047619]],[[0.19494074650752,0.5535714285714],[0.30803598460275,0.52083333333332],[0.43898836555514,0.55803598460275]],[[0.52083333333334,0.61458360365036],[0.52083333333334,0.73214285714283],[0.52083333333334,0.83035714285713]]],[[[0.22023809523811,0.09375027031702],[0.32886931793608,0.09375027031702],[0.44642857142859,0.09375027031702]],[[0.49255979412656,0.17410741317415],[0.49255979412656,0.25148836555512],[0.49255979412656,0.3392857142857]],[[0.42857142857143,0.39880952380953],[0.3452380952381,0.42708360365036],[0.23363122269798,0.39732169888846]],[[0.16071428571429,0.34523809523808],[0.16071428571429,0.24851217507893],[0.16071428571429,0.16517884174558]]]], /*9*/ [[[[0.08192492497048,0.99948105415133],[0.08192492497048,0.99948105415133],[0.11320497697686,1.00097032274275]],[[0.15491207375781,0.99948105415133],[0.20257732722176,0.99203308771824],[0.30684506917413,0.98011677435229]],[[0.40962354253508,0.93543059922983],[0.48410050107247,0.86244345044249],[0.57943100800036,0.77009202185612]],[[0.65092888819626,0.62113810478129],[0.65092888819626,0.40813373278499],[0.65092888819626,0.16087023044081]],[[0.52878667619491,-2.00530949870073e-14],[0.33067769590609,-2.00530949870073e-14],[0.13256925677592,-2.00530949870073e-14]],[[0,0.16087023044081],[0,0.34408381902213],[0,0.50942239639587]],[[0.11171570838543,0.64050184342169],[0.28599152078365,0.64050184342169],[0.38281183746159,0.64050184342169]],[[0.4602678743405,0.60177382498225],[0.51389128448745,0.53623410146932],[0.51389128448745,0.53623410146932]],[[0.51835963142036,0.53623410146932],[0.51835963142036,0.53623410146932],[0.50048516137139,0.65092888819626]],[[0.45430971765752,0.73583235034959],[0.39025926273602,0.79392464858807],[0.33514658399766,0.84605824898494]],[[0.26364870380175,0.87733884214998],[0.18768193551427,0.88776534576587],[0.14299576039183,0.89223423385747]],[[0.11022589863537,0.89521331219896],[0.08192492497048,0.89223423385747],[0.08192492497048,0.89223423385747]]],[[[0.32025119229017,0.09979939501943],[0.32025119229017,0.09979939501943],[0.45728879599901,0.09979939501943]],[[0.51835963142036,0.2264099539537],[0.51835963142036,0.39174907248608],[0.51835963142036,0.41260262087655]],[[0.51389128448745,0.42749801258403],[0.50644331805437,0.43941432595003],[0.4721841877065,0.49750608302988]],[[0.40366538585208,0.54070298956087],[0.31578230419862,0.54070298956087],[0.20257732722176,0.54070298956087]],[[0.12959017843441,0.45579898624894],[0.12959017843441,0.33514658399766],[0.12959017843441,0.19810898028883]],[[0.20853548390474,0.09979939501943],[0.31876138254011,0.09979939501943],[0.31876138254011,0.09979939501943]]]] ]; this._maxWidth = 0.73230769230769; } /*void */ TDigFont.prototype._setFontArial = function() //-------------------------------------------------------------------- { this._pathFont = [ /*0*/ [[[[0.09683681262729,0.89897848778004],[0.09683681262729,0.89897848778004],[0.15071283095723,0.96633146639514]],[[0.22484406822811,0.99999999999999],[0.3192464358452,0.99999999999999],[0.39092731670061,0.99999999999999]],[[0.45026094704684,0.98082675661916],[0.4972314154786,0.94248026985745],[0.54420188391039,0.90413378309574]],[[0.57949338085539,0.8495735743381],[0.60308999490834,0.77881555498983],[0.62668660896129,0.70807344704687]],[[0.63849287169042,0.615246308554],[0.63849287169042,0.5003341395112],[0.63849287169042,0.40325865580451]],[[0.63114180244399,0.32610425152751],[0.61645557535642,0.26887092668025],[0.60175343686353,0.2116535132383]],[[0.58157777494908,0.16310781568231],[0.55592858961302,0.12324974541753],[0.53027940427698,0.08339167515276]],[[0.49754964358452,0.05288951120164],[0.45775521894093,0.03172734215888],[0.41794488289206,0.0105810845214]],[[0.37178589613034,2.00530949870073e-14],[0.3192464358452,2.00530949870073e-14],[0.24799516293279,2.00530949870073e-14]],[[0.18888429226068,0.01907777494911],[0.14191382382891,0.05720150203666],[0.09494335539715,0.09532522912425]],[[0.05954047861507,0.14977405804484],[0.03572110488798,0.22053207739311],[0.0119017311609,0.29129009674138]],[[0,0.38456275458249],[0,0.5003341395112],[0,0.68426998472508]],[[0.0322683299389,0.81714613034623],[0.09683681262729,0.89897848778004],[0.09683681262729,0.89897848778004]]],[[[0.18517693482688,0.16991789714869],[0.18517693482688,0.16991789714869],[0.21835221486761,0.12317018839106]],[[0.26260183299389,0.09979633401222],[0.31790987780041,0.09979633401222],[0.37426807535641,0.09979633401222]],[[0.42125445519348,0.12628882382895],[0.4588690173116,0.17927380346236],[0.49646766802443,0.23225878309573]],[[0.51527494908349,0.3393425407332],[0.51527494908349,0.50050916496946],[0.51527494908349,0.66113480142567]],[[0.49641993380856,0.7680753564155],[0.45874172606923,0.82133082993892],[0.42104760692464,0.87460221486765]],[[0.37455448065173,0.9012219959267],[0.3192464358452,0.9012219959267],[0.2639383910387,0.9012219959267]],[[0.21742935336049,0.8747135947047],[0.17975114562117,0.82166496945013],[0.14205702647657,0.76863225560083]],[[0.12321792260691,0.66158032077394],[0.12321792260691,0.50050916496946],[0.12321792260691,0.33978806008147]],[[0.14387092668024,0.22958566700611],[0.18517693482688,0.16991789714869],[0.18517693482688,0.16991789714869]]]], /*1*/ [[[0.3664596273292,2.00530949870073e-14],[[0.28773615424431,2.00530949870073e-14],[0.28773615424431,2.00530949870073e-14],[0.26646609730848,0.04302536231884]],[[0.23026656314699,0.08740942028986],[0.17915372670807,0.13315217391305],[0.12802471532092,0.17889492753623]],[[0.06830680641821,0.21784420289856],[0,0.25],[0,0.25]],[[0,0.36820652173916],[0,0.36820652173916],[0.03799495341615,0.35416666666669]],[[0.0808585662526,0.33310688405797],[0.12859083850933,0.30502717391306],[0.17632311076606,0.27694746376814]],[[0.21490036231885,0.24886775362319],[0.24430641821947,0.22078804347827],[0.24430641821947,0.22078804347827]],[0.24430641821947,0.99999999999999],[0.3664596273292,0.99999999999999]]], /*2*/ [[[[0.16949728260871,0.88198757763978],[0.16949728260871,0.88198757763978],[0.18324598861284,0.85982789855073]],[[0.20068258281574,0.83776526915115],[0.22177471532092,0.81581586438927],[0.24286684782609,0.7938826345756]],[[0.29016239648035,0.75213509316773],[0.36366136128366,0.69058941511387],[0.45149133022776,0.61637875258799]],[[0.51439570393376,0.55800336438923],[0.55235830745343,0.51544707556936],[0.59030473602486,0.4728907867495]],[[0.61746247412009,0.43237254140787],[0.63383152173913,0.39387616459628],[0.6502005693582,0.35539596273294]],[[0.65838509316771,0.31623641304348],[0.65838509316771,0.27639751552797],[0.65838509316771,0.19807841614909]],[[0.63045095755695,0.13242430124227],[0.57458268633542,0.07945134575572],[0.51871441511388,0.02649456521742]],[[0.44287008281575,2.00530949870073e-14],[0.34704968944099,2.00530949870073e-14],[0.25211891821946,2.00530949870073e-14]],[[0.17650103519671,0.02455357142858],[0.12017986542445,0.07364453933751],[0.06385869565219,0.12275168219462]],[[0.03139557453416,0.19413172877848],[0.02277432712216,0.28778467908904],[0.02277432712216,0.28778467908904]],[[0.14803312629401,0.30020703933749],[0.14803312629401,0.30020703933749],[0.14848602484473,0.23801436335407]],[[0.16648874223604,0.18934394409939],[0.20205745341617,0.15417960662528],[0.23762616459629,0.11903144409939]],[[0.28505111283644,0.10144927536234],[0.34434847308489,0.10144927536234],[0.40042701863354,0.10144927536234]],[[0.4459109730849,0.11806094720497],[0.48080033643892,0.15128429089027],[0.51567352484473,0.18450763457557]],[[0.53312629399587,0.22528467908906],[0.53312629399587,0.27364777432713],[0.53312629399587,0.31992430124226]],[[0.51384575569359,0.36893439440994],[0.47528467908904,0.42067805383024],[0.43672360248449,0.47243788819876]],[[0.36345108695654,0.54271803830228],[0.25548330745343,0.63151850414081],[0.18589868012423,0.6883410973085]],[[0.13253752587992,0.73851578674951],[0.09538366977227,0.7820425724638],[0.05822981366461,0.82558553312631]],[[0.03121765010353,0.86984019151142],[0.01436335403728,0.91480654761905],[0.00388198757766,0.94207751035197]],[[-0.00090579710145,0.97046454451348],[0,0.99999999999999],[0,0.99999999999999]],[0.65942028985509,0.99999999999999],[0.65942028985509,0.88198757763978]]], /*3*/ [[[[0.0404308808554,0.87192909877803],[0.09723459775966,0.92316382382894],[0.15403831466395,0.97439854887985]],[[0.22543279022402,0.99999999999999],[0.31141802443992,0.99999999999999],[0.40675916496944,0.99999999999999]],[[0.48561608961302,0.97027749490836],[0.54798879837066,0.91083248472506],[0.6103615071283,0.85138747454176]],[[0.64154786150713,0.77892693482689],[0.64154786150713,0.69343495417517],[0.64154786150713,0.6302030295316]],[[0.62554098778003,0.5775521894094],[0.59355906313645,0.53546652240327],[0.56156122708758,0.49339676680245]],[[0.5166115071283,0.46567909877802],[0.45869399185336,0.45231351832996],[0.50324592668024,0.43185145112017]],[[0.53688263747454,0.40427698574338],[0.55960412423624,0.36959012219961],[0.58232561099796,0.33490325865581]],[[0.59368635437882,0.29642948065173],[0.59368635437882,0.25416878818738],[0.59368635437882,0.20971232179227]],[[0.58176871181261,0.16769030040734],[0.55793342668024,0.12810272403261],[0.53409814154786,0.08851514765784]],[[0.49966586048879,0.05728105906314],[0.45466840631364,0.03436863543788],[0.40967095213849,0.01145621181263]],[[0.36042515274948,2.00530949870073e-14],[0.30696283095722,2.00530949870073e-14],[0.22942655295316,2.00530949870073e-14]],[[0.16458757637474,0.02213276476579],[0.11246181262729,0.06639829429738],[0.06033604887984,0.11066382382892]],[[0.02692209775966,0.17305244399185],[0.0122199592668,0.25356415478616],[0.0122199592668,0.25356415478616]],[[0.13238289205703,0.27494908350307],[0.13238289205703,0.27494908350307],[0.14130919042769,0.21623599796336]],[[0.16138938391038,0.17219322810593],[0.19263938391037,0.14282077393079],[0.22387347250509,0.11346423116091]],[[0.26292006109979,0.09877800407336],[0.30979506109979,0.09877800407336],[0.35709966904277,0.09877800407336]],[[0.39570073828919,0.11322556008148],[0.42561418024439,0.14212067209778],[0.45551171079429,0.17101578411407]],[[0.47046843177189,0.20745290224033],[0.47046843177189,0.25144793788187],[0.47046843177189,0.30701056517311]],[[0.44991089613033,0.34810972505091],[0.40879582484724,0.3747772403259],[0.36768075356414,0.40144475560085]],[[0.32144220977597,0.41477851323832],[0.27004837067209,0.41477851323832],[0.26513174643585,0.41477851323832]],[[0.25865580448064,0.41433299389005],[0.25063645621181,0.41344195519351],[0.25063645621181,0.41344195519351]],[[0.23725496435844,0.51934826883912],[0.23725496435844,0.51934826883912],[0.27114625763747,0.51043788187373]],[[0.29948447046842,0.50598268839107],[0.32223778004072,0.50598268839107],[0.37799134419552,0.50598268839107]],[[0.42392757128308,0.52389893075357],[0.46006237270875,0.55969959266802],[0.49618126272911,0.59550025458248]],[[0.5142566191446,0.64097505091651],[0.5142566191446,0.69610807026479],[0.5142566191446,0.75391420570265]],[[0.49481288187372,0.8023803462322],[0.45595723014256,0.84150649185339],[0.41710157841139,0.88064854887985]],[[0.3691764256619,0.90020366598779],[0.31219768329938,0.90020366598779],[0.26411341649694,0.90020366598779]],[[0.22355524439917,0.88516738798371],[0.19049134419552,0.85509483197556],[0.15742744399184,0.82502227596744]],[[0.13398994399184,0.77590376782078],[0.12016293279023,0.70773930753566],[0.12016293279023,0.70773930753566]],[[0,0.72403258655807],[0,0.72403258655807],[0.00801934826884,0.80556262729125]]]], /*4*/ [[[0.55717255717254,0.99999999999999],[0.55717255717254,0.76091476091479],[0.69230769230768,0.76091476091479],[0.69230769230768,0.64864864864864],[0.55717255717254,0.64864864864864],[0.55717255717254,2.00530949870073e-14],[0.45738045738045,2.00530949870073e-14],[0,0.64864864864864],[0,0.76091476091479],[0.43451143451142,0.76091476091479],[0.43451143451142,0.99999999999999]],[[0.12077702702701,0.64864864864864],[0.43451143451142,0.19831730769233],[0.43451143451142,0.64864864864864]]], /*5*/ [[[[0.04080939440993,0.87338250517599],[0.09802018633539,0.92402626811596],[0.15523097826086,0.97468620600414]],[[0.22906961697722,0.99999999999999],[0.31953610248447,0.99999999999999],[0.42988159937888,0.99999999999999]],[[0.51695134575568,0.95965967908902],[0.58072916666665,0.8789466873706],[0.63318452380951,0.8132116977226]],[[0.65942028985507,0.7352160973085],[0.65942028985507,0.64499223602486],[0.65942028985507,0.55023938923395]],[[0.62956133540372,0.47269668737063],[0.56985960144927,0.41239648033128],[0.51014169254657,0.35209627329192]],[[0.43686917701862,0.32194616977229],[0.35002587991718,0.32194616977229],[0.28442028985505,0.32194616977229]],[[0.2217747153209,0.34271480331266],[0.16207298136645,0.38423589544515],[0.16207298136645,0.38423589544515]],[0.21580615942028,0.11697722567289],[0.61283643892339,0.11697722567289],[0.61283643892339,2.00530949870073e-14],[0.11801242236023,2.00530949870073e-14],[0.02173913043478,0.5113871635611],[[0.13664596273291,0.52795031055903],[0.13664596273291,0.52795031055903],[0.15472955486541,0.49886775362321]],[[0.17950957556935,0.47521997929608],[0.21098602484471,0.45697463768117],[0.24246247412007,0.43872929606625]],[[0.27804736024844,0.42960662525881],[0.31774068322981,0.42960662525881],[0.38155085403726,0.42960662525881]],[[0.43289013975154,0.44982531055902],[0.47174236542442,0.49023033126295],[0.5105945910973,0.53065152691513]],[[0.53002070393373,0.58582427536232],[0.53002070393373,0.65574857660458],[0.53002070393373,0.72931224120085]],[[0.50978584368529,0.78833462732922],[0.46934847308488,0.83283190993789],[0.42889492753623,0.87734536749483]],[[0.37901138716355,0.89958592132506],[0.31969785196686,0.89958592132506],[0.27049365942027,0.89958592132506]],[[0.22868141821946,0.88400944616977],[0.19426112836437,0.85284032091097],[0.15982466356106,0.82167119565217]],[[0.13785908385092,0.77513586956521],[0.12836438923394,0.71325051759835],[0.12836438923394,0.71325051759835]],[[0,0.7225672877847],[0,0.7225672877847],[0.00813599896479,0.80622412008283]]]], /*6*/ [[[[0.59098141547862,0.10826120162935],[0.54168788187372,0.06495035641551],[0.49239434826884,0.02165542260694]],[[0.42914651221995,2.00530949870073e-14],[0.35197619653768,2.00530949870073e-14],[0.24847250509164,2.00530949870073e-14]],[[0.16616280549898,0.0374077138493],[0.10506300916497,0.11222314154789],[0.035021003055,0.19817655295318]],[[0,0.33579429735235],[0,0.52504455193484],[0,0.69427825865582]],[[0.03161596232179,0.81574592668025],[0.09484788696538,0.88944755600815],[0.15807981160896,0.96314918533605]],[[0.239816700611,0.99999999999999],[0.34002673116089,0.99999999999999],[0.39880346232179,0.99999999999999]],[[0.45134292260693,0.98596614052955],[0.49766102342158,0.95793024439922],[0.54397912423625,0.92989434826884]],[[0.58038441955193,0.88949529022404],[0.60689282077393,0.83673307026479],[0.63338531059063,0.78398676171081]],[[0.64663951120163,0.72689663951122],[0.64663951120163,0.66544679226069],[0.64663951120163,0.57196728615074]],[[0.61844450101832,0.49573574338086],[0.56207039205703,0.43675216395114],[0.50568037169042,0.37776858452138]],[[0.43737270875763,0.34826883910386],[0.35714740325866,0.34826883910386],[0.31122708757636,0.34826883910386]],[[0.26732752036659,0.35896130346234],[0.22543279022404,0.38034623217925],[0.18353806008146,0.40173116089613]],[[0.1481033604888,0.4344768329939],[0.11914460285132,0.47858324847253],[0.12003564154786,0.38056899185337]],[[0.13144411914459,0.30502163951123],[0.15337003564154,0.25195710285134],[0.17529595213849,0.19889256619146]],[[0.20511392566191,0.15854124236256],[0.24282395621181,0.13088721995929],[0.27226005600814,0.1094863798371]],[[0.30621499490836,0.09877800407336],[0.34470468431773,0.09877800407336],[0.39259801425661,0.09877800407336]],[[0.43286978105906,0.11597823319758],[0.46555180753565,0.15037869144606],[0.48523421588594,0.17182726578414]],[[0.50044551934828,0.20621181262731],[0.5112016293279,0.25356415478616],[0.5112016293279,0.25356415478616]],[[0.63034623217922,0.24439918533607],[0.63034623217922,0.24439918533607],[0.62052889511201,0.16807217413445]]],[[[0.15739562118126,0.55163251018331],[0.19520112016293,0.5126495672098],[0.23300661914461,0.47366662423625]],[[0.27903831466396,0.45417515274952],[0.33329620672097,0.45417515274952],[0.38833375763747,0.45417515274952]],[[0.43377673116089,0.47366662423625],[0.46964103869653,0.5126495672098],[0.50548943482688,0.55163251018331]],[[0.5234215885947,0.60496754073321],[0.5234215885947,0.67268648167006],[0.5234215885947,0.74307853869654]],[[0.50526667515275,0.79876845723015],[0.46897275967413,0.83975623727089],[0.43266293279022,0.88074401731164]],[[0.38900203665987,0.9012219959267],[0.33795824847251,0.9012219959267],[0.30292133401223,0.9012219959267]],[[0.26971423116089,0.8913091904277],[0.23830511710795,0.87148357942976],[0.20689600305499,0.85165796843177]],[[0.1824083503055,0.82282650203668],[0.16484215885946,0.78495735743382],[0.14727596741344,0.74708821283096]],[[0.13849287169044,0.70743699083503],[0.13849287169044,0.66600369144605],[0.13849287169044,0.60273994399186]]]], /*7*/ [[[[0.49473684210526,0.11999999999997],[0.49473684210526,0.11999999999997],[0.43194078947369,0.19184210526314]],[[0.37271381578947,0.28014802631578],[0.31703947368421,0.38490131578947],[0.26136513157895,0.48967105263155]],[[0.21863486842105,0.5984539473684],[0.18884868421052,0.71128289473681],[0.15904605263158,0.82411184210525]],[[0.14347039473683,0.92034539473681],[0.1421052631579,0.99999999999999],[0.1421052631579,0.99999999999999]],[[0.26947368421053,0.99999999999999],[0.26947368421053,0.99999999999999],[0.27636513157893,0.89916118421049]],[[0.29222039473684,0.80636513157892],[0.31702302631578,0.72162828947367],[0.3514802631579,0.60144736842102]],[[0.40029605263158,0.48449013157894],[0.46348684210527,0.37074013157893],[0.52666118421052,0.25700657894735]],[[0.59041118421053,0.16578947368421],[0.65473684210525,0.09710526315789],[0.65473684210525,0.09710526315789]],[0.65473684210525,-2.00530949870073e-14],[0,-2.00530949870073e-14],[0,0.11999999999997]]], /*8*/ [[[[0.08098905295314,0.49707230142567],[0.04859343177189,0.54004900712834],[0.01619781059062,0.58304162423628]],[[0,0.63637665478617],[0,0.70005409877801],[0,0.78556199083504]],[[0.02962703665986,0.85694055498984],[0.08888110997963,0.91415796843179],[0.14813518329938,0.97139129327902]],[[0.22611698065171,0.99999999999999],[0.32281059063136,0.99999999999999],[0.41948828920569,0.99999999999999]],[[0.49747008655803,0.97150267311611],[0.5567241598778,0.91449210794297],[0.61597823319754,0.85749745417517]],[[0.64562118126272,0.78712130855397],[0.64562118126272,0.70337958248475],[0.64562118126272,0.64282077393075]],[[0.62998026985742,0.59071092158861],[0.59869844704683,0.54706593686356],[0.56741662423625,0.50342095213851]],[[0.52184635947046,0.4718049898167],[0.46195582993889,0.45220213849291],[0.51037423625254,0.43395175661915]],[[0.54647721486761,0.4080161659878],[0.5702488543788,0.37439536659879],[0.59402049389001,0.34077456720979]],[[0.60590631364562,0.30125063645623],[0.60590631364562,0.25582357433809],[0.60590631364562,0.18457230142566]],[[0.57982752036658,0.12412487270876],[0.52768584521384,0.0744812881874],[0.4755441700611,0.02483770366599]],[[0.40669551934826,2.00530949870073e-14],[0.32113989307536,2.00530949870073e-14],[0.23601387474542,2.00530949870073e-14]],[[0.16783350305498,0.02428080448067],[0.11658286659878,0.07281059063138],[0.06533223014256,0.12134037678209]],[[0.0397148676171,0.18123090631366],[0.0397148676171,0.25248217922609],[0.0397148676171,0.2996913187373]],[[0.05175980142566,0.34021766802447],[0.07586558044806,0.37406122708758],[0.09997135947047,0.40790478615074]],[[0.13702902240326,0.43395175661915],[0.18702265784113,0.45220213849291],[0.12713212830955,0.46779531568231]]],[[[0.17800089103869,0.1723205193483],[0.20816891547861,0.14290033095726],[0.23832102851322,0.11349605397149]],[[0.27654022403258,0.09877800407336],[0.32281059063136,0.09877800407336],[0.36863543788187,0.09877800407336]],[[0.40672734215886,0.1138301934827],[0.4371181262729,0.14390274949086],[0.46749299898166,0.17399121690428]],[[0.48268839103869,0.21109661405297],[0.48268839103869,0.25521894093687],[0.48268839103869,0.29757510183301]],[[0.46793851832993,0.33334394093689],[0.4384546843177,0.3625254582485],[0.40895493890019,0.39172288696538]],[[0.37086303462322,0.40631364562119],[0.32414714867617,0.40631364562119],[0.27609470468431,0.40631364562119]],[[0.23720723014257,0.39161150712833],[0.20750063645621,0.36219131873729],[0.17777813136456,0.33278704175156]],[[0.16293279022403,0.29490198574339],[0.16293279022403,0.24853615071287],[0.16293279022403,0.20753245926681]]],[[[0.14173879837067,0.59768011710794],[0.17879646130344,0.56024058044808],[0.21583821283095,0.52280104378818]],[[0.26284050407331,0.50407331975562],[0.31980333503055,0.50407331975562],[0.37808681262728,0.50407331975562]],[[0.42642566191446,0.52302380346234],[0.46481988289204,0.56090885947047],[0.50319819246435,0.59879391547863]],[[0.52240325865579,0.64670315682281],[0.52240325865579,0.70465249490835],[0.52240325865579,0.76171079429735]],[[0.50375509164968,0.8087449083503],[0.46649058044806,0.84573892566193],[0.42921015784114,0.88273294297352]],[[0.38165096741344,0.9012219959267],[0.32381300916496,0.9012219959267],[0.28680308044806,0.9012219959267]],[[0.25217986252546,0.8924229887984],[0.21991153258656,0.87480906313645],[0.18764320264766,0.85721104887985]],[[0.16347377800407,0.83235743380857],[0.14737143584521,0.80026412932791],[0.13126909368635,0.76817082484725]],[[0.12321792260691,0.73496372199593],[0.12321792260691,0.70064282077392],[0.12321792260691,0.64447556008146]]]], /*9*/ [[[[0.05724923625253,0.89358452138495],[0.10574719959266,0.93614753054993],[0.15422925152748,0.97872645112018]],[[0.21672925152749,0.99999999999999],[0.29324719959266,0.99999999999999],[0.36530995417516,0.99999999999999]],[[0.42814409368635,0.98063581975563],[0.48176552953157,0.9418915478615],[0.53537105397149,0.90314727596742]],[[0.5757382892057,0.84669360997964],[0.6028831466395,0.77254646130347],[0.63001209266802,0.6983993126273]],[[0.64358452138492,0.59876209266805],[0.64358452138492,0.4736188900204],[0.64358452138492,0.35337640020368]],[[0.62988480142566,0.26151985743381],[0.60251718431772,0.19806517311613],[0.57514956720977,0.1346104887984]],[[0.53508464867617,0.08573065173116],[0.48235425152749,0.05144157331978],[0.42960794297351,0.01715249490835]],[[0.37141993380855,2.00530949870073e-14],[0.30777431262728,2.00530949870073e-14],[0.21964103869653,2.00530949870073e-14]],[[0.14630537169043,0.0303112270876],[0.08778322301425,0.09091776985745],[0.02926107433809,0.1515243126273]],[[0,0.23151094704687],[0,0.33087767311611],[0,0.42714167515278]],[[0.02803589613034,0.50467795315684],[0.08412359979632,0.56350241853361],[0.14019539205702,0.62232688391042]],[[0.20874172606925,0.65173116089615],[0.28974669042769,0.65173116089615],[0.3382605651731,0.65173116089615]],[[0.38332166496944,0.63981351832996],[0.42494590122199,0.61597823319758],[0.46655422606925,0.59214294806517]],[[0.49937945519348,0.56106797352342],[0.5234215885947,0.52275330957233],[0.52386710794297,0.53344577393077]],[[0.5240898676171,0.54146512219962],[0.5240898676171,0.54681135437882],[0.5240898676171,0.59670952138492]],[[0.51809126782077,0.6456848268839],[0.5060940682281,0.69373727087576],[0.49409686863544,0.74178971486762]],[[0.47931517311608,0.77992935336048],[0.46171715885946,0.80817209775971],[0.44411914460284,0.83641484215889]],[[0.42136583503054,0.85897721486762],[0.39344131873726,0.87587512729125],[0.36551680244398,0.89277303971488]],[[0.33313709266802,0.9012219959267],[0.29628627800407,0.9012219959267],[0.25319819246435,0.9012219959267]],[[0.21789078411405,0.88908159368635],[0.19036405295315,0.86476896639513],[0.16283732179225,0.84047225050917]],[[0.14418915478614,0.80136201629329],[0.13441955193482,0.74745417515276],[0.13441955193482,0.74745417515276]],[[0.01832993890019,0.75661914460285],[0.01832993890019,0.75661914460285],[0.02811545315681,0.83374172606927]]],[[[0.49223523421589,0.44830384419553],[0.45637092668024,0.48731860997963],[0.4205066191446,0.52633337576376]],[[0.37472950610997,0.54582484725054],[0.31903958757638,0.54582484725054],[0.26344513747453,0.54582484725054]],[[0.21692018839104,0.52633337576376],[0.17943291751527,0.48731860997963],[0.1419456466395,0.44830384419553]],[[0.12321792260691,0.39759419551937],[0.12321792260691,0.33517375254586],[0.12321792260691,0.2656409114053]],[[0.14294806517311,0.20902813136457],[0.18244017311608,0.16533541242362],[0.22193228105906,0.12164269348272]],[[0.26856860997964,0.09979633401222],[0.32238098268838,0.09979633401222],[0.37439536659877,0.09979633401222]],[[0.41869271894092,0.12008337576375],[0.45528895112015,0.16065745926681],[0.49188518329938,0.20123154276987]],[[0.51018329938899,0.25606224541752],[0.51018329938899,0.32514956720981],[0.51018329938899,0.39425280040736]]]] ]; this._maxWidth = 0.69230769230769; } /*void */ TDigFont.prototype._setFontCenturyGoth = function() //-------------------------------------------------------------------- { this._pathFont = [ /*0*/ [[[[0.01371236426457,0.72200456564658],[0.04113709279369,0.79126048864755],[0.06856182132282,0.86051641164857]],[[0.10669114017769,0.91262031095754],[0.15550962487661,0.94757218657451],[0.20431268509378,0.98252406219149]],[[0.25917756663376,0.99999999999999],[0.32008884501481,0.99999999999999],[0.38184846989142,0.99999999999999]],[[0.43800900789733,0.98198420533067],[0.48855503455084,0.9459526159921],[0.5390856367226,0.90992102665349]],[[0.57872655478777,0.85653689536028],[0.60744693978282,0.78576937314905],[0.63616732477789,0.71500185093778]],[[0.65054294175715,0.61986364758143],[0.65054294175715,0.50032391411645],[0.65054294175715,0.38036771964461]],[[0.63595138203356,0.2847976307996],[0.60679911154985,0.21359822309971],[0.57764684106614,0.14239881539977]],[[0.53800592300099,0.08899925962485],[0.48790720631787,0.0533995557749],[0.43779306515302,0.01779985192495]],[[0.38184846989142,-2.00530949870073e-14],[0.32008884501481,-2.00530949870073e-14],[0.25917756663376,-2.00530949870073e-14]],[[0.20409674234947,0.0176918805528],[0.15486179664363,0.05307564165843],[0.10561142645607,0.08845940276407]],[[0.06748210760118,0.14045533070089],[0.04048926456072,0.20906342546889],[0.01349642152024,0.27767152023688]],[[0,0.37476863277391],[0,0.50032391411645],[0,0.62503084896347]]],[[[0.09953418065154,0.31243830207305],[0.11896902764067,0.25735747778874],[0.13840387462981,0.20227665350443]],[[0.1666769496545,0.16058427936819],[0.20381910167818,0.13228035538004],[0.24096125370187,0.10399185587361]],[[0.28067929417571,0.08983218163867],[0.32300407206318,0.08983218163867],[0.36444965449161,0.08983218163867]],[[0.40384378084898,0.10399185587361],[0.44120187561698,0.13228035538004],[0.47855997038501,0.16058427936819]],[[0.50780478775914,0.20529985192495],[0.52896717670288,0.26642707305034],[0.55012956564659,0.32755429417569]],[[0.56071076011847,0.40606490621914],[0.56071076011847,0.50197433366238],[0.56071076011847,0.59745187561695]],[[0.54883390918066,0.67910908193483],[0.52508020730503,0.74693052813423],[0.50607724580455,0.80265918065151]],[[0.47823605626852,0.84445952615992],[0.44152578973347,0.87231614017768],[0.40481552319842,0.90018817867716]],[[0.36531342546891,0.91411648568605],[0.32300407206318,0.91411648568605],[0.28111117966437,0.91411648568605]],[[0.24139313919054,0.8998642645607],[0.20381910167818,0.8713443978282],[0.16624506416584,0.84283995557746]],[[0.13786401776901,0.8010396100691],[0.11864511352418,0.74595878578479],[0.09942620927937,0.69087796150048]],[[0.08983218163871,0.6095446692991],[0.08983218163871,0.50197433366238],[0.08983218163871,0.39397211253699]]]], /*1*/ [[[0,0.09844559585488],[0.15751295336788,0.09844559585488],[0.15751295336788,0.99999999999995],[0.25699481865286,0.99999999999995],[0.25699481865286,-2.00530949870073e-14],[0.06000647668394,-2.00530949870073e-14]]], /*2*/ [[[[0.14658114256824,0.19599974721942],[0.18794236602629,0.15440154196158],[0.22928779069767,0.1128191354904]],[[0.28113940849342,0.09201213346813],[0.34349721941355,0.09201213346813],[0.40274266936298,0.09201213346813]],[[0.45282482305359,0.11185540950456],[0.49374368048534,0.15151036400404],[0.53464673913043,0.19116531850353]],[[0.5551061678463,0.23848268452984],[0.5551061678463,0.29343086450961],[0.5551061678463,0.33686172901922]],[[0.5436994438827,0.37819135490395],[0.52090179474216,0.41740394337716],[0.49810414560162,0.45661653185036]],[[0.44885932760364,0.51677831142567],[0.37316734074822,0.59787348331646],[0.37316734074822,0.59787348331646]],[0,0.99999999999999],[0.66329625884732,0.99999999999999],[0.66329625884732,0.90697674418602],[0.21145096056623,0.90697674418602],[[0.45530523255813,0.64421132457025],[0.45530523255813,0.64421132457025],[0.53199254297269,0.56150467644084]],[[0.58363877654195,0.49593971183011],[0.61024393326591,0.44750063195148],[0.63684908998988,0.39907735085945]],[[0.65015166835187,0.34720993427704],[0.65015166835187,0.29191418099089],[0.65015166835187,0.21318882709807]],[[0.62236160262892,0.14485907482307],[0.56679726996966,0.08690912537918],[0.51123293731042,0.02897497472194]],[[0.43852692113245,2.00530949870073e-14],[0.34866342264913,2.00530949870073e-14],[0.25789939332658,2.00530949870073e-14]],[[0.18163865015166,0.03090242669365],[0.11988119312437,0.09267568250757],[0.05810793731041,0.15444893832153]],[[0.02591001011121,0.23344287158744],[0.02325581395348,0.32962588473205],[0.02325581395348,0.32962588473205]],[[0.11729019211323,0.32962588473205],[0.11729019211323,0.32962588473205],[0.12304095045499,0.25440786147623]]]], /*3*/ [[[[0.17449716189537,0.15048124383021],[0.20442065646595,0.127406219151],[0.2343287265548,0.10433119447184]],[[0.26988215695952,0.09279368213225],[0.31108094768017,0.09279368213225],[0.36179664363277,0.09279368213225]],[[0.40375123395855,0.10789424975321],[0.43691386969398,0.13809538499506],[0.47007650542943,0.1682965202369]],[[0.48667324777888,0.2041121668312],[0.48667324777888,0.24552690029612],[0.48667324777888,0.27358403257648]],[[0.47854454590325,0.29948173741361],[0.46231799111551,0.32320459032576],[0.446076011846,0.3469274432379]],[[0.41999321322805,0.36645483711744],[0.38405417077986,0.38177134748272],[0.34811512833169,0.39708785784795]],[[0.3082891164857,0.40473840078973],[0.26456071076013,0.40473840078973],[0.26456071076013,0.40473840078973]],[[0.26456071076013,0.49259624876603],[0.26456071076013,0.49259624876603],[0.33844397828234,0.49648321816387]],[[0.39300037018757,0.5066016781836],[0.42822988647583,0.52295162882525],[0.46344397828233,0.53931700394865]],[[0.49153195952616,0.56364141164854],[0.51249383020732,0.59592485192497],[0.53344027640672,0.62822371668312]],[[0.54392892398816,0.66288252714709],[0.54392892398816,0.69990128331685],[0.54392892398816,0.75544484205329]],[[0.52298247778875,0.80387771470877],[0.48110500987168,0.84521532576505],[0.43921211747286,0.88655293682132]],[[0.38373025666337,0.90720631786768],[0.31464400296151,0.90720631786768],[0.2537481490622,0.90720631786768]],[[0.20366485686082,0.88971495557746],[0.16437870187563,0.85473223099702],[0.13371483218163,0.82709155972357]],[[0.11019249753209,0.78239141164855],[0.09378084896349,0.72063178677194],[0.09378084896349,0.72063178677194]],[[0,0.72063178677194],[0,0.72063178677194],[0.01684353405727,0.81225320829218]],[[0.05270545409675,0.88170964955575],[0.10758576011846,0.92903195952612],[0.16245064165844,0.97633884501479]],[[0.23093534057257,0.99999999999999],[0.31302443237907,0.99999999999999],[0.37393571076013,0.99999999999999]],[[0.42901653504442,0.98662697433364],[0.47828232971372,0.95989634748269],[0.52753269990129,0.93316572063179]],[[0.5664178183613,0.89532946692988],[0.59493768509378,0.84638758637709],[0.62344212734452,0.79746113030601]],[[0.63770977295164,0.74603590819348],[0.63770977295164,0.69214276900296],[0.63770977295164,0.62961192003947]],[[0.61702554294177,0.57312746791705],[0.5756879318855,0.522673988154],[0.54639684106614,0.48688919052317]],[[0.50893077492596,0.4597266781836],[0.46328973346495,0.44118645113521],[0.54468472359329,0.39324716189532]],[[0.58538993089832,0.32824839585388],[0.58538993089832,0.24619015301085],[0.58538993089832,0.20429726061204]],[[0.57360562685093,0.16411648568606],[0.55003701875617,0.12567867719643],[0.5264684106614,0.08724086870681]],[[0.49318237907207,0.05668497038499],[0.45017892398816,0.03401098223098],[0.40716004442251,0.01133699407697]],[[0.36079405231985,-2.00530949870073e-14],[0.31108094768017,-2.00530949870073e-14],[0.24278134254689,-2.00530949870073e-14]],[[0.18355133267522,0.02116238894373],[0.1334063425469,0.06347174234945],[0.08324592793683,0.10579652023691]],[[0.04931206811452,0.16624506416582],[0.03158933859823,0.24481737413621],[0.03158933859823,0.24481737413621]],[[0.12833168805528,0.24481737413621],[0.12833168805528,0.24481737413621],[0.14913931391906,0.18962857847974]]]], /*4*/ [[[0,0.77350859453995],[0.46713852376138,0.77350859453995],[0.46713852376138,0.99999999999999],[0.56420626895856,0.99999999999999],[0.56420626895856,0.77350859453995],[0.68250758341761,0.77350859453995],[0.68250758341761,0.68048533872597],[0.56420626895856,0.68048533872597],[0.56420626895856,2.00530949870073e-14],[0.54439459049547,2.00530949870073e-14]],[[0.17776794742164,0.68048533872597],[0.46713852376138,0.26935351365013],[0.46713852376138,0.68048533872597]]], /*5*/ [[[0.19009100101113,-2.00530949870073e-14],[[0.1001011122346,0.48432760364001],[0.1001011122346,0.48432760364001],[0.18209681496463,0.44928589484327]],[[0.25191165318504,0.43174924165822],[0.30954562689586,0.43174924165822],[0.37912348331649,0.43174924165822]],[[0.43475101112236,0.45225606673405],[0.47642821031346,0.49326971688573],[0.5180896107179,0.53428336703741]],[[0.53892821031346,0.58763586956521],[0.53892821031346,0.65332722446914],[0.53892821031346,0.7260964357937]],[[0.51581458543985,0.78673217896866],[0.46961893326594,0.83523445399392],[0.42340748230537,0.88373672901919]],[[0.36809593023256,0.90798786653184],[0.30368427704752,0.90798786653184],[0.2707912032356,0.90798786653184]],[[0.23936741658241,0.90079941860462],[0.20938131951467,0.88642252275025],[0.17939522244693,0.87204562689585]],[[0.15539686552073,0.853134479272],[0.13740204752276,0.82968907987865],[0.11940722952478,0.80624368048531]],[[0.10664180990901,0.77572042467136],[0.09908998988878,0.73811931243677],[0.09908998988878,0.73811931243677]],[[0,0.73811931243677],[0,0.73811931243677],[0.01061678463094,0.81542277553083]],[[0.04311488877654,0.87839673913043],[0.09749431243681,0.92704120323557],[0.15187373609708,0.97568566734075]],[[0.21863940849343,0.99999999999999],[0.29779132962589,0.99999999999999],[0.36411463599597,0.99999999999999]],[[0.42258594539939,0.98573369565217],[0.4732052578362,0.95720108695652],[0.52382457027301,0.92866847826087]],[[0.56395348837211,0.88763902932254],[0.59357621334681,0.83411274014153],[0.62319893832154,0.78058645096055]],[[0.63801820020224,0.72173597067742],[0.63801820020224,0.65759289686553],[0.63801820020224,0.56469603134478]],[[0.60916961577352,0.48849848331647],[0.55150404448939,0.42900025278056],[0.49383847320527,0.36950202224469]],[[0.42057949949445,0.33973710819007],[0.33175872093025,0.33973710819007],[0.29772813447928,0.33973710819007]],[[0.25949507077857,0.34591443377147],[0.21707532861476,0.35825328614763],[0.21707532861476,0.35825328614763]],[0.26635174418606,0.09302325581395],[0.61274014155714,0.09302325581395],[0.61274014155714,-2.00530949870073e-14]]], /*6*/ [[[[0.10838783316879,0.43083662388942],[0.10838783316879,0.43083662388942],[0.06771347482725,0.49126974333661]],[[0.03948667324777,0.54297260612043],[0.02369200394866,0.58591436327736],[0.00789733464956,0.62887154491609]],[[0,0.6697772704837],[0,0.70861611549852],[0,0.76085883514311]],[[0.01274062191509,0.80986241362288],[0.03825271470878,0.85561142645606],[0.06374938302071,0.9013604392892]],[[0.09887092793682,0.93686759624875],[0.14360192497532,0.9621174728529],[0.18833292201382,0.98736734945702]],[[0.23684291707798,0.99999999999999],[0.28914733464955,0.99999999999999],[0.34316386969396,0.99999999999999]],[[0.39363277393879,0.98695088845011],[0.44052319842052,0.96085266535042],[0.48741362290225,0.93475444225073]],[[0.52359945705824,0.89960204837116],[0.54911154985191,0.85539548371171],[0.57460821816386,0.81118891905229]],[[0.58736426456071,0.76167633267522],[0.58736426456071,0.70688857354391],[0.58736426456071,0.62709772951626]],[[0.56094212734451,0.55992411154983],[0.50812870187561,0.50535229516287],[0.45529985192497,0.45078047877591]],[[0.39099518756169,0.42349457058243],[0.31523013326751,0.42349457058243],[0.28492102665349,0.42349457058243]],[[0.25249876604146,0.42929417571569],[0.21794792694964,0.44087796150049],[0.21794792694964,0.44087796150049]],[0.47636969397827,0.05093163869691],[0.39782823297136,-2.00530949870073e-14]],[[[0.39552998519249,0.52690029615002],[0.43475444225073,0.56586253701875],[0.47396347482723,0.60482477788744]],[[0.49358341559722,0.65208538993088],[0.49358341559722,0.70762894866732],[0.49358341559722,0.76275604639681]],[[0.47400974827245,0.80980071569594],[0.43489326258637,0.84876295656463],[0.39576135241855,0.88772519743336]],[[0.3485315893386,0.90720631786768],[0.29318854886476,0.90720631786768],[0.23784550839091,0.90720631786768]],[[0.1906003208292,0.88772519743336],[0.15148383514314,0.84876295656463],[0.11235192497532,0.80980071569594]],[[0.09279368213227,0.76275604639681],[0.09279368213227,0.70762894866732],[0.09279368213227,0.65208538993088]],[[0.11224395360315,0.60482477788744],[0.15115992102665,0.56586253701875],[0.19006046396841,0.52690029615002]],[[0.23725937808489,0.50740375123395],[0.29272581441263,0.50740375123395],[0.34819225074036,0.50740375123395]]]], /*7*/ [[[0,0.09302325581395],[0.46649077350859,0.09302325581395],[0.01515103640039,0.95860717896863],[0.09605662285136,0.99999999999999],[0.61880687563195,-2.00530949870073e-14],[0,-2.00530949870073e-14]]], /*8*/ [[[[0.54351246298125,0.3999876604146],[0.56618645113524,0.36633144126357],[0.58886043928925,0.33267522211251]],[[0.60019743336624,0.29428368706811],[0.60019743336624,0.25112598716682],[0.60019743336624,0.20796828726554]],[[0.58822803553801,0.16676949654489],[0.56430466436327,0.12749876604145],[0.54038129318855,0.08824346001972]],[[0.50729577986179,0.05717855380059],[0.46504812438303,0.03430404738398],[0.42280046890425,0.01144496544916]],[[0.3768972112537,-2.00530949870073e-14],[0.32732292694966,-2.00530949870073e-14],[0.27645298617967,-2.00530949870073e-14]],[[0.22914610069102,0.01133699407697],[0.18540227048372,0.03398013326751],[0.14164301579468,0.05663869693977]],[[0.10736981737415,0.0877036031589],[0.08258267522212,0.12717485192498],[0.0577955330701,0.16666152517273]],[[0.04540967423494,0.20710451628825],[0.04540967423494,0.24853467423492],[0.04540967423494,0.28953294669298]],[[0.05707058242843,0.32792448173742],[0.0803923988154,0.36374012833168],[0.10371421520237,0.39955577492594]],[[0.13869693978283,0.42954096742347],[0.18534057255676,0.45369570582427],[0.11883020730504,0.48692003948668]],[[0.07130737907207,0.52478714215201],[0.0427875123396,0.56729701382032],[0.01425222112537,0.60980688548863]],[[0,0.65759192991114],[0,0.71066757156959],[0,0.78316263573544]],[[0.02722421026655,0.84951875616976],[0.08167263079962,0.90970508390918],[0.13612105133269,0.96990683613031]],[[0.21606614017769,0.99999999999999],[0.32150789733465,0.99999999999999],[0.43083662388944,0.99999999999999]],[[0.51488462487662,0.96569595261595],[0.57365190029615,0.89708785784796],[0.6216220384995,0.84098901776898]],[[0.64560710760118,0.77625246791707],[0.64560710760118,0.70289363277391],[0.64560710760118,0.65069718657453]],[[0.63144743336625,0.60408440276406],[0.60314350937809,0.56308613030601],[0.57482416090819,0.52208785784796]],[[0.52850444225075,0.48562438302073],[0.46415350444226,0.45369570582427],[0.50950148075025,0.42910908193484]]],[[[0.42616300592299,0.10897396347481],[0.45707366732479,0.14131910167817],[0.48798432872656,0.17366423988154]],[[0.50345508390919,0.20903257650542],[0.50345508390919,0.24740868706811],[0.50345508390919,0.27458662388943]],[[0.49561944718658,0.30164116485685],[0.47994817374136,0.32858773445211],[0.46427690029615,0.35554972852912]],[[0.4424821076012,0.37678923988152],[0.41457922013821,0.39230626850935],[0.38666090819349,0.40783872161894]],[[0.35704590325764,0.41559723593287],[0.32570335636723,0.41559723593287],[0.27674605133268,0.41559723593287]],[[0.23392769002962,0.39846063672259],[0.19721742349457,0.36417201382034],[0.16050715695954,0.32989881539977]],[[0.14215202369201,0.29161525172752],[0.14215202369201,0.24933674728528],[0.14215202369201,0.20664178183612]],[[0.15921150049359,0.16988524185585],[0.19334587857848,0.13905170286278],[0.22748025666339,0.10821816386968]],[[0.2705299851925,0.09279368213225],[0.32247963968411,0.09279368213225],[0.38129318854887,0.09279368213225]]],[[[0.44232786278382,0.52210328232971],[0.4857323543929,0.56333292201379],[0.52913684600199,0.60457798617966]],[[0.55083909180652,0.65174605133266],[0.55083909180652,0.70485254195458],[0.55083909180652,0.75970199901283]],[[0.53032453109576,0.80762586377096],[0.48929540967424,0.84863956071072],[0.44826628825272,0.88966868213228]],[[0.39300037018757,0.91016781836127],[0.32346680651531,0.91016781836127],[0.27855071569596,0.91016781836127]],[[0.2390331934847,0.9017614758144],[0.20491423988155,0.88491794175715],[0.17079528627839,0.86807440769986]],[[0.14424975320829,0.8441201875617],[0.12524679170781,0.81302443237906],[0.10624383020731,0.78192867719642]],[[0.09674234945707,0.74890486179662],[0.09674234945707,0.71392213721618],[0.09674234945707,0.65736056268508]],[[0.11896902764067,0.60781712734449],[0.16345323297137,0.56527640671271],[0.20793743830207,0.52275111056269]],[[0.26300283810465,0.50148075024678],[0.32864943237908,0.50148075024678],[0.38997717176703,0.50148075024678]]]], /*9*/ [[[[0.47826690523199,0.56947186574531],[0.47826690523199,0.56947186574531],[0.51883329220138,0.50906959526158]],[[0.54698297137216,0.45741300592299],[0.56274679170779,0.41448667324777],[0.57849518756169,0.37156034057255]],[[0.58637709772951,0.33046952122405],[0.58637709772951,0.29121421520237],[0.58637709772951,0.23944965449161]],[[0.5736364758144,0.19069286771963],[0.54818608094769,0.1449592793682],[0.52273568608095,0.09924111549852]],[[0.48767583909181,0.06364141164854],[0.44302196446199,0.03819101678182],[0.39835266535045,0.01274062191507]],[[0.34970384995064,-2.00530949870073e-14],[0.29707551826258,-2.00530949870073e-14],[0.2435679911155,-2.00530949870073e-14]],[[0.19340757650543,0.01315708292202],[0.14659427443237,0.03947124876602],[0.09976554787759,0.06578541461006]],[[0.06362598716682,0.10095323297134],[0.03817559230009,0.14494385488645],[0.01272519743336,0.18893447680155]],[[0,0.23832366732476],[0,0.29311142645607],[0,0.37291769496543]],[[0.02639128825271,0.44009131293186],[0.07917386475814,0.49466312931886],[0.13195644126358,0.54923494570582]],[[0.19619940769991,0.57650542941754],[0.2719336130306,0.57650542941754],[0.30221187068115,0.57650542941754]],[[0.33463413129318,0.57081379565644],[0.369184970385,0.55939967917076],[0.369184970385,0.55939967917076]],[0.11113339091806,0.94946939782821],[0.18953603158934,0.99999999999999]],[[[0.19151036525173,0.47313055281342],[0.15242472852911,0.4341991609082],[0.11332366732478,0.39526776900294]],[[0.09378084896347,0.34825394866731],[0.09378084896347,0.29318854886476],[0.09378084896347,0.23812314906216]],[[0.11326196939783,0.19112475320829],[0.15222421026654,0.15219336130303],[0.19118645113524,0.11326196939781]],[[0.23823112043435,0.09378084896345],[0.29335821816387,0.09378084896345],[0.34890177690029,0.09378084896345]],[[0.39616238894373,0.11326196939781],[0.43512462981244,0.15219336130303],[0.47408687068114,0.19112475320829]],[[0.49358341559724,0.23812314906216],[0.49358341559724,0.29318854886476],[0.49358341559724,0.34825394866731]],[[0.47424111549852,0.39526776900294],[0.43558736426457,0.4341991609082],[0.39693361303059,0.47313055281342]],[[0.34973469891411,0.49259624876603],[0.29402147087857,0.49259624876603],[0.23870927936822,0.49259624876603]]]] ]; this._maxWidth = 0.68250758341759; } /*obj */ TDigFont.prototype._digToShape = function(/*int*/ dig, /*obj*/ page) //-------------------------------------------------------------------- { var digPaths = this._pathFont[dig]; var sz = digPaths.length; var shape = page.polygons.add(); shape.paths[0].entirePath = digPaths[0]; for ( var i=1 ; i < sz ; i++ ) shape.paths.add({pathType:PathType.closedPath,entirePath:digPaths[i]}); return(shape); } /*obj */ TDigFont.prototype.createDig = function(/*int*/ dig, /*arr*/ cellDims, /*arr*/ orig, /*obj*/ page, /*float*/widthCoef, /*[bool]*/V_STRETCH, /*[bool]*/H_CENTER) //-------------------------------------------------------------------- // Cree un Polygon formant le chiffre dig dans la fonte courante et dans l'espace ("cellule") // specifie en argument : // - cellDims (=[w,h]) : largeur et hauteur de la cellule conteneur // - orig (=[x,y]) : origine (x,y) de la cellule conteneur dans le referentiel courant // - page : objet Page cible // - widthCoef : coefficient correcteur de la largeur (1 = "toute la largeur dispo dans la cell.") // - V_STRETCH : si TRUE, autorise le stretch vertical de la forme // - H_CENTER : si TRUE, la forme est horiz-centree dans la cellule au lieu d'etre alignee a gauche { var digShape = this._digToShape(dig, page); //geoBounds = [0,0,1,w]; // Calcul des dimensions finales var scale = Math.min(cellDims[1],cellDims[0]*widthCoef/this._maxWidth); var h = scale; var w = scale*digShape.geometricBounds[3]; if ((h < cellDims[1]) && (V_STRETCH)) h = cellDims[1]; // Translation dans la cellule var tX = (H_CENTER) ? orig[0]+(cellDims[0]-w)/2 : orig[0]; var tY = orig[1]+(cellDims[1]-h); digShape.geometricBounds = [tY, tX, tY+h, tX+w]; return(digShape); } //-------------------------------------------------------------------- // CLASS TMetrics //-------------------------------------------------------------------- // CONSTANTES PARAMETRABLES (manipuler avec precaution) var OPT_WH_RATIO = 1.9; // ratio optimal largeur/hauteur var OPT_BAR_RATIO = 90; // hauteur optimale des barres / hauteur de la grille (en %) var MAX_DIG_RATIO = 92; // hauteur max des chiffres dans l'espace disponible (en %) var DEF_WIDTH_RATIO = 25; // largeur par defaut d'un code-barre (en % de la largeur dispo) // COEFICIENTS DEDUITS var _KW = OPT_WH_RATIO; // coef optimal Width/Height var _KB = OPT_BAR_RATIO/100; // coef optimal Bar/Grid var _KD = MAX_DIG_RATIO/100; // coef maxi hauteur digit var _KX = (1/_KW)*(1-_KB)/(2/_KD-_KB); // coef tq : W*KX = hD/2 (demi-hauteur digit) var MAX_WH_RATIO = _KD/(2*_KX); // ratio max Width/Height var MIN_GLOBAL_WIDTH = 51 /*pts*/; // largeur totale mini d'un code-barres (= 102 * 0,5pts) // DEFINE var SP_GLOB=0; // espace de reference (global) var SP_GRID=1; // espace de la grille var SP_DIGS=2; // espace des chiffres /*obj */ function TMetrics(/*TLBR*/ frameBounds) //-------------------------------------------------------------------- // CONSTRUCTEUR base sur l'espace de travail limite par frameBounds [top,left,bottom,right] { var maxDims = [ frameBounds[3]-frameBounds[1], // largeur de la surface de travail frameBounds[2]-frameBounds[0] // hauteur de la surface de travail ]; if ( TMetrics.ratioOverflow(maxDims) ) // si largeur/hauteur trop grand, maxDims = TMetrics.fixDims(maxDims,1,true); // reduire la largeur a la limite var w = maxDims[0] * DEF_WIDTH_RATIO/100; // largeur par defaut du code-barres if ( w < MIN_GLOBAL_WIDTH ) w = MIN_GLOBAL_WIDTH; this._Origin = [0,0]; this._Dims = [w, w/OPT_WH_RATIO]; this._MinMax = [ [MIN_GLOBAL_WIDTH, maxDims[0]], // Wmin,Wmax [MIN_GLOBAL_WIDTH/MAX_WH_RATIO, maxDims[1]] // Hmin,Hmax ]; } /*bool*/ TMetrics.ratioOverflow = function(/*arr*/dims) // STATIQUE //-------------------------------------------------------------------- // Ret. true si dims=[w,h] provoque un depassement de MAX_WH_RATIO { return( dims[0] > dims[1]*MAX_WH_RATIO ); } /*arr */ TMetrics.fixDims = function(/*arr*/dims, /*[int]*/keep_dim, /*[bool]*/USE_MAX_RATIO) // STATIQUE //-------------------------------------------------------------------- // Corrige les dimensions dims=[w,h] de telle sorte que le ratio w/h soit: // - optimal (si USE_MAX_RATIO == false ou non fourni) // - maximal (si USE_MAX_RATIO == true) // La correction s'opere: // - en conservant w et en augmentant h (si keep_dim==0 ou non fourni) // - en conservant h et en reduisant w (si keep_dim==1) // Ret. le tableau [w,h] obtenu // !! La correction est inconditionnelle, l'appelant appellera _ratioOverflow() au prealable si besoin !! { var wh = (USE_MAX_RATIO) ? MAX_WH_RATIO : OPT_WH_RATIO; return( (keep_dim) ? [dims[1]*wh , dims[1]] : [dims[0] , dims[0]/wh] ); } /*arr */ TMetrics.transGrid = function(/*arr*/dims, /*[bool]*/GRID_TO_GLOB) // STATIQUE //-------------------------------------------------------------------- // Convertit des dimensions dims=[w,h] de SP_GLOB vers SP_GRID // Si GRID_TO_GLOB, operation reciproque { if ( GRID_TO_GLOB ) { var wGlob = dims[0] * 102/95; return([wGlob, dims[1]+wGlob*_KX]); } else // GLOB TO GRID return([dims[0] * 95/102, dims[1]-dims[0]*_KX]); } /*arr */ TMetrics.transDigs = function(/*arr*/dims) // STATIQUE //-------------------------------------------------------------------- // Convertit des dimensions dims=[w,h] de SP_GLOB vers SP_DIGS { return([dims[0] * 99/102, dims[0] * 2 * _KX]); } /*bool*/ TMetrics.prototype._outOfRange = function(/*arr*/dims) //-------------------------------------------------------------------- // Teste l'acceptabilite des dims [w,h] (espace global) dans les fourchettes min-max // Renvoie true si les valeurs testees sont hors-limite, false sinon { return( ( dims[0] < this._MinMax[0][0] ) || ( dims[0] > this._MinMax[0][1] ) || ( dims[1] < this._MinMax[1][0] ) || ( dims[1] > this._MinMax[1][1] ) ); } /*flag*/ TMetrics.prototype.setDimsByDialog = function(/*arr*/_dims, /*[bool]*/ GRID_SPACE) //-------------------------------------------------------------------- // [ Interface simplifiee a usage du preset ] // Tente de renseigner les dimensions a partir de _dims=[w,h] // Les dims specifiees sont relatives a SP_GRID si GRID_SPACE, sinon globales // Renvoie : // zero si OK (0), // -1 si outOfRange // +1 si ratioOverflow { var dims = (GRID_SPACE) ? TMetrics.transGrid(_dims, true) : _dims; if ( this._outOfRange(dims) ) return(-1); if ( TMetrics.ratioOverflow(dims) ) return(1); this._Dims = dims; return(0); } /*bool*/ TMetrics.prototype.setDimsByBounds = function(/*TLBR*/ bounds) //-------------------------------------------------------------------- // [ Interface simplifiee a usage du preset ] // Renseigne les dimensions a partir de bounds // Si la hauteur est trop faible, affecte la hauteur optimale // Renvoie TRUE si OK, FALSE si outOfRange { var dims = [bounds[3]-bounds[1] , bounds[2]-bounds[0]]; if ( this._outOfRange(dims) ) return(false); if ( TMetrics.ratioOverflow(dims) ) dims = TMetrics.fixDims(dims); this._Dims = dims; return(true); } /*void*/ TMetrics.prototype.setOrigin = function(/*TLBR*/ frameBounds, /*[bool]*/ FIT_TOP_RIGHT) //-------------------------------------------------------------------- // Place la metrique par rapport a frameBounds // Par defaut, la metrique est centree dans frameBounds // Si FIT_TOP_RIGHT, la metrique est ajustee au coin superieur droit de frameBounds { this._Origin = (FIT_TOP_RIGHT) ? [ frameBounds[3]-this._Dims[0], frameBounds[0] ] : [ (frameBounds[1]+frameBounds[3]-this._Dims[0])/2, (frameBounds[0]+frameBounds[2]-this._Dims[1])/2 ]; } /*arr */ TMetrics.prototype.getDims = function(/*[enum]*/ _space) //-------------------------------------------------------------------- // Renvoie les dimensions actuelles selon l'espace argument (SP_GLOB | SP_GRID | SP_DIGS) // Par defaut SP_GLOB { return( (_space) ? ( ( _space == SP_GRID ) ? TMetrics.transGrid(this._Dims) : TMetrics.transDigs(this._Dims) ) : this._Dims ); } /*arr */ TMetrics.prototype.getOrigin = function(/*[enum]*/ _space) //-------------------------------------------------------------------- // Renvoie l'origine actuelle dans l'espace argument (SP_GLOB | SP_GRID | SP_DIGS) // Par defaut SP_GLOB { var delta = [0,0]; if ( _space ) { var i = ( _space == SP_GRID ) ? 0 : 1; delta[i] = this._Dims[i] - this.getDims(_space)[i]; } return([this._Origin[0]+delta[0] , this._Origin[1]+delta[1]]); } /*float*/ TMetrics.prototype.getMinMax = function(/*0|1*/ axis, /*0|1*/ minmax) //-------------------------------------------------------------------- // Renvoie une dimension min ou max (dans l'espace global) // axis : 0=width , 1=height // minmax : 0=min , 1=max { return(this._MinMax[axis][minmax]); } /*float*/ TMetrics.prototype.getBarCoef = function() //-------------------------------------------------------------------- // Renvoie la hauteur des barres par rapport a la hauteur de la grille { var dg = this._Dims[0] * _KX; return( 1 + ((1 - 2/_KD)*dg) / (this._Dims[1] - dg) ); } //-------------------------------------------------------------------- // CLASS TCode //-------------------------------------------------------------------- var CODES = [ // A B // B N B N B N B N /*0*/ [ [3,2,1,1], [1,1,2,3] ], /*1*/ [ [2,2,2,1], [1,2,2,2] ], /*2*/ [ [2,1,2,2], [2,2,1,2] ], /*3*/ [ [1,4,1,1], [1,1,4,1] ], /*4*/ [ [1,1,3,2], [2,3,1,1] ], /*5*/ [ [1,2,3,1], [1,3,2,1] ], /*6*/ [ [1,1,1,4], [4,1,1,1] ], /*7*/ [ [1,3,1,2], [2,1,3,1] ], /*8*/ [ [1,2,1,3], [3,1,2,1] ], /*9*/ [ [3,1,1,2], [2,1,1,3] ] ] var TABLES = [ // tables de codage a utiliser pour les // 6 PREMIERS SEGMENTS (chiffres 2 a 7) // en fonction du 1ER CHIFFRE de l'EAN /*0*/ [0,0,0,0,0,0], // AAAAAA /*1*/ [0,0,1,0,1,1], // AABABB /*2*/ [0,0,1,1,0,1], // AABBAB /*3*/ [0,0,1,1,1,0], // AABBBA /*4*/ [0,1,0,0,1,1], // ABAABB /*5*/ [0,1,1,0,0,1], // ABBAAB /*6*/ [0,1,1,1,0,0], // ABBBAA /*7*/ [0,1,0,1,0,1], // ABABAB /*8*/ [0,1,0,1,1,0], // ABABBA /*9*/ [0,1,1,0,1,0], // ABBABA // le codage des 6 DERNIERS SEGMENTS // (chiffres 8 a 13) utilisera la table A, // a interpreter "negativement" (N<->B) ]; var CODE_OK_FLAG = 1; // ean OK var CODE_FIXED_FLAG = 2; // checksum invalide mais corrigee var CODE_ERROR_FLAG = 4; // ean defectueux (syntax error) /*obj */ function TCode() //---------------------------------------------------------- // CONSTRUCTEUR // { this._digits = null; this._status = 0; } /*void*/ TCode.prototype.setDigits = function(/*str*/ _eanString) //-------------------------------------------------------------------- // Analyse une chaine de 12 ou 13 chiffres et cree si besoin le 13e chiffre (checksum) // et met a jour les flags de this._status : // - FIXED_FLAG si le 13e chiffre etait fourni mais incorrect // - ERROR_FLAG si la chaine fournie n'est pas analysable comme un code EAN // NB. On peut fournir a setDigits un ISBN-13 { this._digits = null; this._status = 0; var eanString = _eanString.replace(/[^\d]/g,''); if ( ! eanString.match(/^[\d]{12,13}$/) ) { this._status |= CODE_ERROR_FLAG; return; } var sz = eanString.length; this._digits = []; for (var i=0 ; i < sz ; i++ ) this._digits.push(eanString[i]-0); if ( sz == 12 ) { // ajouter la checksum this._digits.push(this._checkSum()); } else { // verifier la checksum var cs = this._digits[12]; // 13e digit this._digits[12] = this._checkSum(); // recalcul if ( cs != this._digits[12] ) this._status |= CODE_FIXED_FLAG; } this._status |= CODE_OK_FLAG; } /*bool*/ TCode.prototype.isValidCode = function() //-------------------------------------------------------------------- // Ret. true si le code est non nul et valide (status OK) { return( ( this._status & CODE_OK_FLAG ) ? true : false ); } /*bool*/ TCode.prototype.badChecksum = function() //-------------------------------------------------------------------- // Ret. true si la checksum initialement fournie etait invalide { return( ( this._status & CODE_FIXED_FLAG ) ? true : false ); } /*bool*/ TCode.prototype.errorCode = function() //-------------------------------------------------------------------- // Ret. true si le code dernierement fourni etait defectueux { return( ( this._status & CODE_ERROR_FLAG ) ? true : false ); } /*var */ TCode.prototype.getCheckSum = function() //-------------------------------------------------------------------- // Ret. la checksum (int) du code s'il est valide, sinon renvoie NULL { return ( (this.isValidCode() ) ? this._digits[12] : null ); } /*str */ TCode.prototype.toString = function(/*[bool]*/ _asISBN) //-------------------------------------------------------------------- // Renvoie les chiffres de l'EAN sous forme de chaine concatenee // SI _isbn : decoupe la chaine par des tirets selon l'ISBN { if ( ! this.isValidCode() ) return(null); var r = this._digits.join(""); if (_asISBN) return(r.substr(0,3) + "-" + r[3] + "-" + r.substr(4,5) + "-" + r.substr(9,3) + "-" + r[12]); else return(r); } /*arr */ TCode.prototype.getSegments = function() //-------------------------------------------------------------------- // Ret. un meta-tableau de 12 "segments" representant les barres du code // - 6 premiers segments de type [B,N,B,N] // - 6 derniers segments de type [N,B,N,B] // tq chaque valeur N ou B ( = 1|2|3|4 ) indique l'epaisseur de la barre { if ( ! this.isValidCode() ) return(null); var r = []; var d = 1; var table = TABLES[this._digits[d-1]]; for (d = 2 ; d <= 7 ; d++ ) r.push(CODES[this._digits[d-1]][table[d-2]]); for (d = 8 ; d <= 13 ; d++ ) r.push(CODES[this._digits[d-1]][0]); return(r); } /*int */ TCode.prototype._checkSum = function() //-------------------------------------------------------------------- // (L'appelant doit garantir que this._digits est un tableau de 12 ou 13 chiffres) // Calcule (ou recalcule) la checksum des 12 premiers chiffres de this._digits { var r = 0; var mult = 1; for (var d = 12 ; d >= 1 ; d--) { mult = 4 - mult; r += ( mult * this._digits[d-1]); } r = 10 - ( r % 10 ); return( ( r != 10 ) ? r : 0 ); } //-------------------------------------------------------------------- // CLASS TPreset //-------------------------------------------------------------------- var DEF_EAN13 = "978-2-XXXXX-YYY-K"; // ISBN ou EAN13 par defaut var LBL_BAROFFSET = "_BAROFFSET"; var LBL_EAN13 = "_EAN13"; var LBL_DIGFONT = "_DIGFONT"; var LBL_DIGOFFSET = "_DIGOFFSET"; var LBL_VSTRETCH = "_VSTRETCH"; /*obj */ function TPreset(/*obj*/ doc, /*obj*/ pg) //---------------------------------------------------------- // CONSTRUCTEUR // { BLACK_SWATCH = doc.swatches.item(BLACK_SWATCH); NONE_SWATCH = doc.swatches.item(NONE_SWATCH); this._doc = doc; this._page = pg; this._dlgCtrls = null; this._code = new TCode(); this._barOffset = 100; this._target = null; this._remove = null; this._replaceFlag = false; this._updateFlag = false; this._ean13 = DEF_EAN13; this._digFont = new TDigFont(); this._digOffset = 20; this._vStretch = false; // Preset metrique this._userUnits = [ doc.viewPreferences.horizontalMeasurementUnits, doc.viewPreferences.verticalMeasurementUnits ]; this._metrics = new TMetrics(this._getPointsBounds(this._page)); if ( doc.selection.length > 0 ) this._presetByPattern(doc.selection[0]); } /*void*/ TPreset.prototype.setPointsUnits = function(/*bool*/ PTS_ON) //-------------------------------------------------------------------- // Commutateur d'unites points/user // !! Methode publique car invoquee par TBarCode !! { var units = (PTS_ON) ? [MeasurementUnits.points,MeasurementUnits.points] : this._userUnits; with (this._doc.viewPreferences) { horizontalMeasurementUnits = units[0]; verticalMeasurementUnits = units[1]; } } /*TLBR*/ TPreset.prototype._getPointsBounds = function(/*obj*/ obj) //-------------------------------------------------------------------- // Renvoie les dimensions en pts de l'objet argument // null en cas d'erreur { var r = null; this.setPointsUnits(true); try { r = ( obj.constructor.name == "Page" ) ? obj.bounds : obj.geometricBounds; } catch(ex) {} this.setPointsUnits(false); return(r); } /*bool*/ TPreset.prototype._dimsByPattern = function(/*[obj]*/ _pattern) //-------------------------------------------------------------------- // Rafraichit les dims selon pattern (en optimisant la hauteur si ratioOverflow) // Si pattern n'est pas fourni, utilise this._target // Renvoie FALSE si erreur ou outOfRange { var bounds = this._getPointsBounds( (_pattern) ? _pattern : this._target ); if (bounds) return(this._metrics.setDimsByBounds(bounds)); else return(false); } /*void*/ TPreset.prototype.tagBarCode = function(/*obj*/ bcGroup) //-------------------------------------------------------------------- // Etiquette l'objet Group du barcode (insertLabel) pour assurer la persistance de donnees { var objs = [ bcGroup , bcGroup.pageItems[0] ]; for(var i=0 ; i<= 1 ; i++) { objs[i].insertLabel(SCRIPT_NAME,"1"); objs[i].insertLabel(SCRIPT_NAME + LBL_BAROFFSET,""+this._barOffset); objs[i].insertLabel(SCRIPT_NAME + LBL_EAN13,""+this._ean13); objs[i].insertLabel(SCRIPT_NAME + LBL_DIGFONT,this._digFont.getFontName()); objs[i].insertLabel(SCRIPT_NAME + LBL_VSTRETCH,(this._vStretch)?"1":""); objs[i].insertLabel(SCRIPT_NAME + LBL_DIGOFFSET,""+this._digOffset); } } /*bool*/ TPreset.prototype._tryGetTags = function(/*obj*/ _obj) //-------------------------------------------------------------------- { var r = false; var barOffset = null; var ean13 = null; var digFont = null; var vStretch = null; var digOffset = null; var obj = _obj; r = (obj.extractLabel(SCRIPT_NAME) == "1"); if ( (!r) && obj.constructor.name == "Group" ) { obj = obj.pageItems[0]; r = (obj.extractLabel(SCRIPT_NAME) == "1"); } if (r) { barOffset = obj.extractLabel(SCRIPT_NAME + LBL_BAROFFSET); ean13 = obj.extractLabel(SCRIPT_NAME + LBL_EAN13); digFont = obj.extractLabel(SCRIPT_NAME + LBL_DIGFONT); vStretch = (obj.extractLabel(SCRIPT_NAME + LBL_VSTRETCH)=="1"); digOffset = obj.extractLabel(SCRIPT_NAME + LBL_DIGOFFSET); } if ( barOffset ) this._barOffset = barOffset-0; if ( ean13 ) this._ean13 = ean13; if ( digFont ) this._digFont.setFont(digFont); if ( vStretch ) this._vStretch = true; if ( digOffset ) this._digOffset = digOffset-0; return(r); } /*void*/ TPreset.prototype._presetByPattern = function(/*obj*/ pattern) //-------------------------------------------------------------------- { // Test: code-barre preexistant a mettre a jour this._updateFlag = this._tryGetTags(pattern); this._replaceFlag = this._dimsByPattern(pattern); if (this._replaceFlag) { pattern.select(); this._target = pattern; } } /*void*/ TPreset.prototype._autoSetOrigin = function() //-------------------------------------------------------------------- { var FIT_TARGET = ( (this._target) && (this._remove || (!this._updateFlag)) ); var bounds = this._getPointsBounds( (FIT_TARGET) ? this._target : this._page ); this._metrics.setOrigin(bounds, FIT_TARGET); } /*bool*/ TPreset.prototype.setDigits = function(/*str*/ _eanString) //-------------------------------------------------------------------- // Analyse une chaine de 12 ou 13 chiffres et cree si besoin le 13e chiffre (checksum) // Retourne false si erreur syntaxique { this._code.setDigits(_eanString); return(this._code.isValidCode()); } /*bool*/ TPreset.prototype.badChecksum = function() //-------------------------------------------------------------------- { return( this._code.badChecksum() ); } /*bool*/ TPreset.prototype.errorCode = function() //-------------------------------------------------------------------- { return( this._code.errorCode() ); } /*int */ TPreset.prototype.getCheckSum = function() //-------------------------------------------------------------------- { return ( this._code.getCheckSum() ); } /*str */ TPreset.prototype.getCode = function(/*[bool]*/ _asISBN) //-------------------------------------------------------------------- { var asISBN = (_asISBN) ? true : false; return( this._code.toString(asISBN) ); } /*arr */ TPreset.prototype.getCodeSegments = function() //-------------------------------------------------------------------- // cf. TCode.getSegments { return(this._code.getSegments()); } /*void*/ TPreset.prototype.optRemoveTarget = function() //-------------------------------------------------------------------- { try { if ( (this._target) && (this._remove) ) { this._target.remove(); this._target = null; } } catch(ex) {} } /*arr*/ TPreset.prototype.getGridDims = function() //-------------------------------------------------------------------- { return(this._metrics.getDims(SP_GRID)); } /*arr*/ TPreset.prototype.getGridOrigin = function() //-------------------------------------------------------------------- { return(this._metrics.getOrigin(SP_GRID)); } /*arr*/ TPreset.prototype.getDigsDims = function() //-------------------------------------------------------------------- { return(this._metrics.getDims(SP_DIGS)); } /*arr*/ TPreset.prototype.getDigsOrigin = function() //-------------------------------------------------------------------- { return(this._metrics.getOrigin(SP_DIGS)); } /*float*/ TPreset.prototype.getFinalBarCoef = function() //-------------------------------------------------------------------- // Ret. le coef multiplicateur k tel que barHeight = gridHeigt*k // apres avoir corrige le coefficient de base par barOffset { var k = this._metrics.getBarCoef(); return( k * this._barOffset/100 ); } /*obj*/ TPreset.prototype.getPage = function() //-------------------------------------------------------------------- { return(this._page); } /*obj*/ TPreset.prototype.getFont = function() //-------------------------------------------------------------------- { return(this._digFont); } /*float*/ TPreset.prototype.getVStretch = function() //-------------------------------------------------------------------- { return(this._vStretch); } /*float*/ TPreset.prototype.getDigCoef = function() //-------------------------------------------------------------------- { var digCoef = 20+this._digOffset*.4; // 0-100 -> 20-60 return( (100-digCoef) / 100 ); } /*void*/ TPreset.prototype.connectDialog = function(/*obj*/ dlg) //-------------------------------------------------------------------- // Construit le dialogue dlg en conservant en interne les controles a interroger/actualiser { this._dlgCtrls = new Object(); this._dlgCtrls.ean13 = null; this._dlgCtrls.remove = null; this._dlgCtrls.gridSpace = null; this._dlgCtrls.dims = [null,null]; this._dlgCtrls.barOffset = null; this._dlgCtrls.dimPanel = null; this._dlgCtrls.digFont = null; this._dlgCtrls.vStretch = null; this._dlgCtrls.digOffset = null; with(dlg) { with(dialogColumns.add()) { // --------------- EAN-13 FIELD with(dialogRows.add()) { staticTexts.add({staticLabel: DLG_EAN_13[LANG]}); this._dlgCtrls.ean13 = textEditboxes.add({editContents: this._ean13, minWidth:180}); } // --------------- OPTIONNAL REPLACE/UPDATE RADIO if ( this._replaceFlag ) { with(dialogRows.add()) { with(radiobuttonGroups.add()) { this._dlgCtrls.remove = radiobuttonControls.add ({ staticLabel: (this._updateFlag)?DLG_UPDATE_BC[LANG]:DLG_REMOVE_PAT[LANG], checkedState: true }); radiobuttonControls.add ({ staticLabel: (this._updateFlag)?DLG_CREATE_BC[LANG]:DLG_KEEP_PAT[LANG], checkedState: false }); } } } with(dialogRows.add()){staticTexts.add({staticLabel: ""});} // --------------- DIMENSIONS PANEL this._dlgCtrls.dimPanel = (this._replaceFlag) ? enablingGroups.add({staticLabel:" "+DLG_DIM_PANEL[LANG], checkedState:false, minWidth:180}) : borderPanels.add({minWidth:180}); with(this._dlgCtrls.dimPanel) { with(dialogColumns.add()) { if (!this._replaceFlag) with(dialogRows.add()) staticTexts.add({staticLabel: DLG_DIM_PANEL[LANG]+" :"}); with(dialogRows.add()) { for (var i=0 ; i<=1 ; i++) { staticTexts.add({staticLabel: DLG_DIMS[i][LANG]}); this._dlgCtrls.dims[i] = measurementEditboxes.add ({ editValue: this._metrics.getDims()[i], editUnits: this._userUnits[i], minimumValue: this._metrics.getMinMax(i,0), maximumValue: this._metrics.getMinMax(i,1), smallNudge: 1, largeNudge: 1, minWidth:75 }); } } with(dialogRows.add()) this._dlgCtrls.gridSpace = checkboxControls.add ({ staticLabel: DLG_GRID_SPACE[LANG], checkedState:false }); with(dialogRows.add()) { staticTexts.add({staticLabel: DLG_BAR_OFFSET[LANG]}); this._dlgCtrls.barOffset = percentEditboxes.add ({ editValue: this._barOffset, minimumValue:0, maximumValue:100, smallNudge:1, largeNudge:5, minWidth:50 }); } } } with(dialogRows.add()){staticTexts.add({staticLabel: ""});} // --------------- DIGITS PANEL with(borderPanels.add({minWidth:180})) { with(dialogColumns.add()) { with(dialogRows.add()) { staticTexts.add({staticLabel: DLG_DIG_PANEL[LANG]+" : "}); this._dlgCtrls.digFont = dropdowns.add ({ stringList: TDigFont.getFontList(), selectedIndex: this._digFont.getFontIndex() }); } with(dialogRows.add()) { staticTexts.add({staticLabel: DLG_DIG_OFFSET[LANG]}); this._dlgCtrls.digOffset = percentEditboxes.add ({ editValue: this._digOffset, minimumValue:0, maximumValue:100, smallNudge:1, largeNudge:5, minWidth:50 }); } with(dialogRows.add()) { this._dlgCtrls.vStretch = checkboxControls.add ({ staticLabel: DLG_VSTRETCH[LANG], checkedState: this._vStretch }); } } } } } } /*bool*/ TPreset.prototype.keepDialog = function(/*obj*/ dlg) //-------------------------------------------------------------------- { // Verif des dimensions var KEEP_DIAL = false; var displayDims = null; var _resetOnTarget = ( this._replaceFlag ) ? ( !this._dlgCtrls.dimPanel.checkedState ) : false; if ( _resetOnTarget ) { // reinitialisation sur les dims du gabarit this._dimsByPattern(); displayDims = this._metrics.getDims(); this._dlgCtrls.gridSpace.checkedState = false; this._dlgCtrls.barOffset.editValue = this._barOffset; } else { // dimensionner selon valeurs saisies var inputDims = [this._dlgCtrls.dims[0].editValue,this._dlgCtrls.dims[1].editValue]; var GRID_SPACE = this._dlgCtrls.gridSpace.checkedState; var redimStatus = this._metrics.setDimsByDialog(inputDims,GRID_SPACE); if ( redimStatus != 0 ) // erreur (outOfRange ou ratioOverlow) { if ( redimStatus == -1 )// outOfRange (apres conversion) : reafficher dernieres dims { alert(DLG_OUT_OF_RANGE[LANG]); displayDims = this._metrics.getDims(( GRID_SPACE ) ? SP_GRID : SP_GLOB); } else // ratioOverflow : proposer ajustement hauteur (optimal ou maximal) { var d = (GRID_SPACE) ? TMetrics.transGrid(inputDims,true) : inputDims; d = TMetrics.fixDims(d,0, (!confirm(DLG_OPTIMIZE_RATIO[LANG]))); displayDims = (GRID_SPACE) ? TMetrics.transGrid(d) : d; } KEEP_DIAL = true; } } if (displayDims) { this._dlgCtrls.dims[0].editValue = displayDims[0]; this._dlgCtrls.dims[1].editValue = displayDims[1]; } if (KEEP_DIAL) return(true); // Verif du code this.setDigits(this._dlgCtrls.ean13.editContents); if ( this.errorCode() ) { alert(DLG_BAD_CODE[LANG]); return(true); } if ( this.badChecksum() ) { var c = this.getCode(true); alert(DLG_FIXED_CHECKSUM[LANG] + c); this._dlgCtrls.ean13.editContents = c; return(true); } // VALIDATION this._ean13 = this.getCode(true); this._barOffset = this._dlgCtrls.barOffset.editValue; this._remove = ( this._dlgCtrls.remove ) ? ( (this._dlgCtrls.remove.checkedState ) ) : false; this._autoSetOrigin(); this._digFont.setFont(this._dlgCtrls.digFont.selectedIndex); this._digOffset = this._dlgCtrls.digOffset.editValue; this._vStretch = this._dlgCtrls.vStretch.checkedState; return(false); } //-------------------------------------------------------------------- // CLASS TGridShape //-------------------------------------------------------------------- /*obj */ function TGridShape(/*arr*/origin, /*arr*/dims, /*obj*/page, /*obj*/barCoef) //---------------------------------------------------------- // CONSTRUCTEUR // - origin : origine [x,y] de la grille // - dims : dimensions [w,h] de la grille // - page : page-cible // - barCoef : coefficient reducteur des barres utiles { this._origin = (origin) ? origin : [0,0]; // coords de l'origine de la grille this._baseWidth = dims[0]/95; // la grille utilise tjs 95 unites en largeur this._gridHeight = dims[1]; // hauteur de la grille (=lignes de garde) this._barHeight = this._gridHeight*barCoef; // hauteur des barres utiles this._page = page; this._x = null; // abscisse courante (cf. _createShape) this._shape = null; // graphique de la grille (assemblage) } /*void*/ TGridShape.prototype.display = function(/*arr*/ segments) //-------------------------------------------------------------------- // Affiche la "grille", cad l'ensemble des barres graphiques // segments fournit les epaisseurs relatives des barres // dans un tableau de type flag[12][4] (cf. TCode) { if ( this._shape ) { this._shape.remove(); this._shape = null; } this._createShape(segments); } /*obj*/ TGridShape.prototype.getShape = function() //-------------------------------------------------------------------- { return(this._shape); } /*void*/ TGridShape.prototype._createShape = function(/*arr*/ segments) //-------------------------------------------------------------------- { this._x = this._origin[0]; this._shape = []; var i = null; // garde gauche this._addBlock // NBN ([1,1,1], true, true); // 6 premiers blocs for (i = 0 ; i <= 5 ; i++) // BNBN this._addBlock(segments[i], false, false); // garde centrale this._addBlock // BNBNB ([1,1,1,1,1], false, true); // 6 derniers blocs for (i = 6 ; i <= 11 ; i++) // NBNB this._addBlock(segments[i], true, false); // garde droite this._addBlock // NBN ([1,1,1], true, true); // fusion des barres var tmp = this._shape.pop(); this._shape = tmp.addPath(this._shape); } /*void*/ TGridShape.prototype._addBlock = function(/*arr*/ segment, /*bool*/ BLACK_FIRST, /*bool*/ USE_MAX_HEIGHT) //-------------------------------------------------------------------- { var bk = (BLACK_FIRST) ? 1 : 0; var sz = segment.length; var w = null; var h = ( USE_MAX_HEIGHT ) ? this._gridHeight : this._barHeight; var blackLine = null; for (var i = 0 ; i < sz ; i++ ) { w = segment[i] * this._baseWidth; // largeur relle de la barre if ( bk == 1) { blackLine = this._page.rectangles.add(); with(blackLine) { fillColor = BLACK_SWATCH; strokeColor = NONE_SWATCH; geometricBounds = [ this._origin[1], // top this._x, // left this._origin[1] + h, // bottom this._x + w // right ]; } this._shape.push(blackLine); } this._x += w; bk = 1 - bk; } } //-------------------------------------------------------------------- // CLASS TDigsShape //-------------------------------------------------------------------- /*obj */ function TDigsShape(/*arr*/origin, /*arr*/dims, /*obj*/page, /*[float]*/ wCoef, /*[bool]*/ V_STRETCH) //---------------------------------------------------------- // CONSTRUCTEUR // - origin : origine [x,y] de la zone chiffree // - dims : dimensions [w,h] de la zone // - page : page-cible // - wCoef : coefficient d'occupation horizontale // - V_STRETCH : autoriser stretch vertical { this._origin = (origin) ? origin : [0,0]; // coords de l'origine de la zone chiffree this._vStretch = (V_STRETCH) ? true : false; // autoriser le stretch vertical this._wCoef = (wCoef) ? wCoef : .9; // coef d'occupation horizontale this._baseWidth = dims[0]/99; // la zone chiffree utilise 99 unites this._digDims = [7*this._baseWidth,dims[1]] // dimensions d'un bloc-chiffre (7 unites de large) this._page = page; this._x = null; // abscisse courante (cf. _createShape) this._shape = null; // graphique de la zone chiffree (assemblage) this._digFont = null; // fonte de chiffres (fournie via display) } /*void*/ TDigsShape.prototype.display = function(/*str*/ code, /*TDigFont*/ digFont) //-------------------------------------------------------------------- { if ( this._shape ) { this._shape.remove(); this._shape = null; } this._createShape(code,digFont); } /*obj*/ TDigsShape.prototype.getShape = function() //-------------------------------------------------------------------- { return(this._shape); } /*void*/ TDigsShape.prototype._createShape = function(/*str*/ code, /*TDigFont*/ digFont) //-------------------------------------------------------------------- { this._digFont = digFont; this._x = this._origin[0]; this._shape = []; var i = null; // chiffre de rang 0 this._addDigit(code[0], false); // X ------ ------ // justifie a gauche this._x += (3 * this._baseWidth); // decaler de +3 unites // chiffres de rangs 1-6 for (i = 1 ; i <= 6 ; i++) // - XXXXXX ------ this._addDigit(code[i], true); this._x += ( 5 * this._baseWidth); // decaler de +5 unites // chiffres de rangs 7-12 for (i = 7 ; i <= 12 ; i++) // NBNB this._addDigit(code[i], true); // fusion des chiffres? var tmp = this._shape.pop(); this._shape = tmp.addPath(this._shape); } /*void*/ TDigsShape.prototype._addDigit = function(/*int*/ dig, /*bool*/ H_CENTER) //-------------------------------------------------------------------- { var shape = this._digFont.createDig ( dig, // chiffre (int) this._digDims, // dims du bloc-chiffre [this._x,this._origin[1]], // coordonnees [x,y] this._page, // page-cible this._wCoef, // occupation horiz this._vStretch, // streching vertical ? H_CENTER // centrage horizontal ? ); with(shape) { fillColor = BLACK_SWATCH; strokeColor = NONE_SWATCH; } this._shape.push(shape); this._x += this._digDims[0]; } //-------------------------------------------------------------------- // CLASS TBarCode //-------------------------------------------------------------------- /*obj */ function TBarCode(/*TPreset&*/ preset) //---------------------------------------------------------- // CONSTRUCTEUR // { this._preset = preset; this._gridShape = new TGridShape ( preset.getGridOrigin(), preset.getGridDims(), preset.getPage(), preset.getFinalBarCoef() ); this._digsShape = new TDigsShape ( preset.getDigsOrigin(), preset.getDigsDims(), preset.getPage(), preset.getDigCoef(), preset.getVStretch() ) } /*void */ TBarCode.prototype._display = function() //-------------------------------------------------------------------- // Affiche les composants du barcode { this._preset.setPointsUnits(true); // affichage de la grille this._gridShape.display(this._preset.getCodeSegments()); // affichage des chiffres this._digsShape.display(this._preset.getCode(), this._preset.getFont()); var pg = this._preset.getPage(); var gr = pg.groups.add([this._gridShape.getShape(),this._digsShape.getShape()]); gr.pageItems[1].bringToFront(); this._preset.tagBarCode(gr); gr.select(); this._preset.setPointsUnits(false); } /*void */ TBarCode.prototype.execute = function() //-------------------------------------------------------------------- // Affiche le barcode { this._display(); this._preset.optRemoveTarget(); } //-------------------------------------------------------------------- // MAIN DIALOG //-------------------------------------------------------------------- /*bool*/ Application.prototype.mainDialog = function(/*TPreset&*/ preset) //---------------------------------------------------------- // Display dialog & return TRUE on validation (CANCEL -> FALSE) // Affiche le dialogue et renvoie TRUE si validation { // Build dialog box / Construction du dialogue var dlgTitle = SCRIPT_NAME + " " + SCRIPT_VERSION; var dlg = this.dialogs.add( {name:dlgTitle, canCancel:true} ); preset.connectDialog(dlg); // Display dialog box / Affichage du dialogue var dlgOK = false; while (dlg.show() == true) { if ( preset.keepDialog(dlg) ) continue; dlgOK = true; break; } dlg.destroy(); return( dlgOK ); } //-------------------------------------------------------------------- // MAIN PROCESS //-------------------------------------------------------------------- /*void*/ Application.prototype.main = function() //---------------------------------------------------------- // Programme principal { if ( this.documents.length == 0 ) {alert(ERR_NO_DOCUMENT[LANG]);return;} selObj = this.activeDocument.selection[0]; var SCAN_FONT = false; var selObjName = (selObj) ? selObj.constructor.name : ""; switch(selObjName) { case "InsertionPoint" : selObj = (parseInt(this.version)<=3) ? selObj.parentTextFrame : selObj.parentTextFrames[0]; selObj.select(); case "TextFrame" : SCAN_FONT = confirm(DLG_SCAN_FONT_CF[LANG]); break; default: break; } try { var tmp = selObj.geometricBounds.length; } catch(ex) { this.activeDocument.select(NothingEnum.nothing); } if (SCAN_FONT) { TDigFont.scanFontToClipboard(this.activeDocument,selObj); alert(DLG_SCAN_FONT_OK[LANG]); } else { var preset = new TPreset(this.activeDocument, this.activeWindow.activePage); if ( this.mainDialog(preset) ) { var barCode = new TBarCode(preset); barCode.execute(); } } } app.main();