rain13 Posted October 23, 2011 Share Posted October 23, 2011 function dessine_exposant makes brackets too tall. I couldn't find what causes it or how to modify it. I looked into php image functions I couldnt chage it. All i managed to change is exponents location and Image's height so that image half that didnt fit in given height was cut off. But I couldnt change height of brackets. Here's what x_{1,2} = a; (abc)(defg) looks like:And here's what x_{1,2} = a; (abc)(def^g) looks like:Problem is that with 2nd image brackets around def^g are too large. It would be perfectly fine it they were as large as first brackets. It makes image look bit strange and ugly. Code can be viewed here:http://autoit.net.ee/downloads/mathpublisher.phps Link to comment Share on other sites More sharing options...
justsomeguy Posted October 23, 2011 Share Posted October 23, 2011 It looks like the affiche_text and affiche_math functions write the text. The ImageTTFBox function calculates the pixel size of a given piece of text in a certain font and font size. Link to comment Share on other sites More sharing options...
rain13 Posted October 30, 2011 Author Share Posted October 30, 2011 I tested that function affiche_texte($texte, $taille) doesn't get called in my case. I also figured that if I change $img = ImageCreate(max($dx,1), max($dy,1)); to $img = ImageCreate(max($dx,1), max($dy,1)/2); in function affiche_math($texte, $taille) Then it just leaves lower half of image out. like on attached image: little debugging shows thatbrackets never get passed to that function DEBUG: STR => "affiche_math: a , 15"DEBUG: STR => "affiche_math: b , 15"DEBUG: STR => "affiche_math: 2 , 12" debugging codefunction affiche_math($texte, $taille){Debug("affiche_math: ".$texte." , ".$taille); Full code with debugging functions (you can pas upto 255 arguments to Debug function). <?phpfunction Debug($var1 = NULL, $var2 = NULL, $var3 = NULL, $var4 = NULL, $var5 = NULL, $var6 = NULL, $var7 = NULL, $var8 = NULL, $var9 = NULL, $var10 = NULL, $var11 = NULL, $var12 = NULL, $var13 = NULL, $var14 = NULL, $var15 = NULL, $var16 = NULL, $var17 = NULL, $var18 = NULL, $var19 = NULL, $var20 = NULL, $var21 = NULL, $var22 = NULL, $var23 = NULL, $var24 = NULL, $var25 = NULL, $var26 = NULL, $var27 = NULL, $var28 = NULL, $var29 = NULL, $var30 = NULL, $var31 = NULL, $var32 = NULL, $var33 = NULL, $var34 = NULL, $var35 = NULL, $var36 = NULL, $var37 = NULL, $var38 = NULL, $var39 = NULL, $var40 = NULL, $var41 = NULL, $var42 = NULL, $var43 = NULL, $var44 = NULL, $var45 = NULL, $var46 = NULL, $var47 = NULL, $var48 = NULL, $var49 = NULL, $var50 = NULL, $var51 = NULL, $var52 = NULL, $var53 = NULL, $var54 = NULL, $var55 = NULL, $var56 = NULL, $var57 = NULL, $var58 = NULL, $var59 = NULL, $var60 = NULL, $var61 = NULL, $var62 = NULL, $var63 = NULL, $var64 = NULL, $var65 = NULL, $var66 = NULL, $var67 = NULL, $var68 = NULL, $var69 = NULL, $var70 = NULL, $var71 = NULL, $var72 = NULL, $var73 = NULL, $var74 = NULL, $var75 = NULL, $var76 = NULL, $var77 = NULL, $var78 = NULL, $var79 = NULL, $var80 = NULL, $var81 = NULL, $var82 = NULL, $var83 = NULL, $var84 = NULL, $var85 = NULL, $var86 = NULL, $var87 = NULL, $var88 = NULL, $var89 = NULL, $var90 = NULL, $var91 = NULL, $var92 = NULL, $var93 = NULL, $var94 = NULL, $var95 = NULL, $var96 = NULL, $var97 = NULL, $var98 = NULL, $var99 = NULL, $var100 = NULL, $var101 = NULL, $var102 = NULL, $var103 = NULL, $var104 = NULL, $var105 = NULL, $var106 = NULL, $var107 = NULL, $var108 = NULL, $var109 = NULL, $var110 = NULL, $var111 = NULL, $var112 = NULL, $var113 = NULL, $var114 = NULL, $var115 = NULL, $var116 = NULL, $var117 = NULL, $var118 = NULL, $var119 = NULL, $var120 = NULL, $var121 = NULL, $var122 = NULL, $var123 = NULL, $var124 = NULL, $var125 = NULL, $var126 = NULL, $var127 = NULL, $var128 = NULL, $var129 = NULL, $var130 = NULL, $var131 = NULL, $var132 = NULL, $var133 = NULL, $var134 = NULL, $var135 = NULL, $var136 = NULL, $var137 = NULL, $var138 = NULL, $var139 = NULL, $var140 = NULL, $var141 = NULL, $var142 = NULL, $var143 = NULL, $var144 = NULL, $var145 = NULL, $var146 = NULL, $var147 = NULL, $var148 = NULL, $var149 = NULL, $var150 = NULL, $var151 = NULL, $var152 = NULL, $var153 = NULL, $var154 = NULL, $var155 = NULL, $var156 = NULL, $var157 = NULL, $var158 = NULL, $var159 = NULL, $var160 = NULL, $var161 = NULL, $var162 = NULL, $var163 = NULL, $var164 = NULL, $var165 = NULL, $var166 = NULL, $var167 = NULL, $var168 = NULL, $var169 = NULL, $var170 = NULL, $var171 = NULL, $var172 = NULL, $var173 = NULL, $var174 = NULL, $var175 = NULL, $var176 = NULL, $var177 = NULL, $var178 = NULL, $var179 = NULL, $var180 = NULL, $var181 = NULL, $var182 = NULL, $var183 = NULL, $var184 = NULL, $var185 = NULL, $var186 = NULL, $var187 = NULL, $var188 = NULL, $var189 = NULL, $var190 = NULL, $var191 = NULL, $var192 = NULL, $var193 = NULL, $var194 = NULL, $var195 = NULL, $var196 = NULL, $var197 = NULL, $var198 = NULL, $var199 = NULL, $var200 = NULL, $var201 = NULL, $var202 = NULL, $var203 = NULL, $var204 = NULL, $var205 = NULL, $var206 = NULL, $var207 = NULL, $var208 = NULL, $var209 = NULL, $var210 = NULL, $var211 = NULL, $var212 = NULL, $var213 = NULL, $var214 = NULL, $var215 = NULL, $var216 = NULL, $var217 = NULL, $var218 = NULL, $var219 = NULL, $var220 = NULL, $var221 = NULL, $var222 = NULL, $var223 = NULL, $var224 = NULL, $var225 = NULL, $var226 = NULL, $var227 = NULL, $var228 = NULL, $var229 = NULL, $var230 = NULL, $var231 = NULL, $var232 = NULL, $var233 = NULL, $var234 = NULL, $var235 = NULL, $var236 = NULL, $var237 = NULL, $var238 = NULL, $var239 = NULL, $var240 = NULL, $var241 = NULL, $var242 = NULL, $var243 = NULL, $var244 = NULL, $var245 = NULL, $var246 = NULL, $var247 = NULL, $var248 = NULL, $var249 = NULL, $var250 = NULL, $var251 = NULL, $var252 = NULL, $var253 = NULL, $var254 = NULL) { //global $OPT_NO_DBG; //if($OPT_NO_DBG !== true){ for($i = 1 ;$i < 255;$i++) { eval('$var = $var'.$i.";"); //echo '$var = $var'.$i."<br>"; if($var !== NULL) { $DebugData = GetDebugText($var); echo $DebugData; file_put_contents("/home/rain/www/mata/Debug.html", $DebugData, $FILE_APPEND); } } //}}function GetDebugText($var) { if (is_bool($var)){ $sStr = "false"; if ($var){$sStr = "true";} return 'DEBUG: BOOL => "'.$sStr.'"<br>'; } if (is_int($var)){ return 'DEBUG: INT => "'.$var.'"<br>'; } if (is_float($var)){ return 'DEBUG: FLOAT => "'.$var.'"<br>'; } if (is_object($var)){ return 'DEBUG: OBJECT => "'.$var.'"<br>'; } if (is_string($var)){ return 'DEBUG: STR => "'.$var.'"<br>'; } if (is_resource($var)){ return 'DEBUG: RESOURCE => "'.$var.'"<br>'; } if (is_array($var)){ return 'DEBUG: ARRAY => "'.ArrayDisplay($var).'"<br>'; }}function ArrayDisplay($aArray,$LineEnd = "<br>\n") { $keys = array_keys($aArray); $data = ""; for($i = 0; $i < count($aArray); $i++) { $data .= "[".$keys[$i]."] = '".$aArray[$keys[$i]]."'".$LineEnd; } return $data;}//Original library code Link to comment Share on other sites More sharing options...
boen_robot Posted October 30, 2011 Share Posted October 30, 2011 Please don't post code pieces THAT large... and TWICE too. It's impossible to navigate over this code.I removed the second time you included this monster... I think even the first is unnecessary - you might want to ask the developer why this happens. Maybe it's a bug that he'd want to fix. If not, he'll surely know why this happens and advice on changes best. And when you ask him, don't include a giant copy of his own library. Link to comment Share on other sites More sharing options...
rain13 Posted October 30, 2011 Author Share Posted October 30, 2011 I tried to e-mail the author but haven't got any response. I noticed that Code function and variable names are not in english. It makes me think that maybe that coder doesn't understand english and that's why I haven't got response. who knows that. That's why i thought i could maybe get some help from this forums. Sorry for posting that code "monster". Link to comment Share on other sites More sharing options...
justsomeguy Posted October 31, 2011 Share Posted October 31, 2011 It doesn't look like the complete code is posted, but as far as I can tell only the affiche_symbol function actually writes text to the image. That's what the imagettftext function does. The language is French, by the way. Link to comment Share on other sites More sharing options...
boen_robot Posted November 1, 2011 Share Posted November 1, 2011 It was initially full. Apparently, SoItBegins edited the first post in some way. I initially tried to do that, but canceled doing so, because I noticed the code was clipped. Apparently, IPB has some limit on post length when editing, and this library is so big that it actually reached it.The full code is at the given link in the code... Math isn't on my strong side though, so I don't know why the brackets are larger. Link to comment Share on other sites More sharing options...
rain13 Posted November 1, 2011 Author Share Posted November 1, 2011 It's from dokuwiki's plugin http://www.dokuwiki.org/plugin:math2 but that code wasn't made just for dokuwiki I think. I it was made to use with any software. I think some blogs use it too. Edit: changed first post. Hope it's better now. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.