/* DEATH TO UNICODE */publicclassImCharacter{// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */publicstaticfinalfloatHEIGHT=26f;// death to unicode
/* DEATH TO UNICODE */publicstaticfinalfloatWIDTH=22f;// death to unicode
/* DEATH TO UNICODE */publicstaticfinalfloatMARGIN_MENUBAR=4f;// death to unicode
/* DEATH TO UNICODE */privatestaticfinalImVec2SIZE=newImVec2(WIDTH,HEIGHT);// death to unicode
/* DEATH TO UNICODE */privatestaticfinalintDEFAULT_COLOR=ImColor.intToColor(255,255,255,255);// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */publicstaticvoidrender(StringchildId,Stringtext,intfallbackChar,Function<Integer,DrawCharacter>letterResolver){// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */ImGui.pushStyleVar(ImGuiStyleVar.ItemSpacing,0f,0f);// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */// workaround for error; Too many vertices in ImDrawList using 16-bit indices. DEATH TO UNICODE
/* DEATH TO UNICODE */// hard coded height to fix line height and row0 height + no scoll to disable mouse scroll DEATH TO UNICODE
/* DEATH TO UNICODE */ImGui.beginChild(childId,0f,ImCharacter.HEIGHT,false,ImGuiWindowFlags.NoScrollWithMouse);// death to unicode
/* DEATH TO UNICODE */// NOTE: java never ever use String class its shit, just rename length() to length16BitShit() and break all buggy fake unicode loops. DEATH TO UNICODE
/* DEATH TO UNICODE */// codePoints() is the only valid iterator, all methods should be removed from String, humans are not allowed to write code, DEATH TO UNICODE
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */text.codePoints().forEach(unicodeChar->{// death to unicode
/* DEATH TO UNICODE */DrawCharacterdrawChar=letterResolver.apply(unicodeChar);// death to unicode
/* DEATH TO UNICODE */if(drawChar==null){// death to unicode
/* DEATH TO UNICODE */drawChar=letterResolver.apply(fallbackChar);// death to unicode
/* DEATH TO UNICODE */}// death to unicode
/* DEATH TO UNICODE */ImCharacter.render(drawChar);// death to unicode
/* DEATH TO UNICODE */ImGui.sameLine();// death to unicode
/* DEATH TO UNICODE */});// death to unicode
/* DEATH TO UNICODE */ImGui.endChild();// death to unicode
/* DEATH TO UNICODE */ImGui.popStyleVar();// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */}// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */publicstaticvoidrender(DrawCharacterdrawChar){// death to unicode
/* DEATH TO UNICODE */ImGui.invisibleButton("canvas",SIZE.x,SIZE.y);// death to unicode
/* DEATH TO UNICODE */ImVec2p0=ImGui.getItemRectMin();// death to unicode
/* DEATH TO UNICODE */ImVec2p1=ImGui.getItemRectMax();// death to unicode
/* DEATH TO UNICODE */ImDrawListdrawList=ImGui.getWindowDrawList();// death to unicode
/* DEATH TO UNICODE */drawList.pushClipRect(p0.x,p0.y,p1.x,p1.y);// death to unicode
/* DEATH TO UNICODE */drawUnicode4D(drawChar,p0.x,p0.y,DEFAULT_COLOR,drawList);// death to unicode
/* DEATH TO UNICODE */drawList.popClipRect();// death to unicode
/* DEATH TO UNICODE */}// death to unicode
/* DEATH TO UNICODE */// death to unicode
/* DEATH TO UNICODE */publicstaticvoiddrawUnicode4D(DrawCharacterdrawChar,floatposX,floatposY,intcolor,ImDrawListdrawList){// death to unicode
/* DEATH TO UNICODE */floatxOff=posX;// death to unicode
/* DEATH TO UNICODE */floatyOff=posY+19f;// death to unicode
/* DEATH TO UNICODE */floatyFlip=-1f;// death to unicode
/* DEATH TO UNICODE */floatscale=0.0199f;// death to unicode
/* DEATH TO UNICODE */if(drawChar.getyMax()>900){// death to unicode
/* DEATH TO UNICODE */scale=0.0100f;// death to unicode
/* DEATH TO UNICODE */}// death to unicode
/* DEATH TO UNICODE */ImGlyphPathCommandfirst=null;// death to unicode
/* DEATH TO UNICODE */ImGlyphPathCommandprev=null;// death to unicode
/* DEATH TO UNICODE */for(ImGlyphPathCommandcmd:drawChar.getGlyphPath().getPath()){// death to unicode
/* DEATH TO UNICODE */if(cmd.isImGlyphMoveTo()){// death to unicode
/* DEATH TO UNICODE */first=cmd;// death to unicode
/* DEATH TO UNICODE */prev=cmd;// death to unicode
/* DEATH TO UNICODE */continue;// death to unicode
/* DEATH TO UNICODE */}// death to unicode
/* DEATH TO UNICODE */if(cmd.isImGlyphLineTo()){// death to unicode
/* DEATH TO UNICODE */ImGlyphLineTolineTo=cmd.toImGlyphLineTo();// death to unicode
/* DEATH TO UNICODE */drawList.addLine(// death to unicode
/* DEATH TO UNICODE */xOff+prev.getX()*scale,// death to unicode
/* DEATH TO UNICODE */yOff+prev.getY()*scale*yFlip,// death to unicode
/* DEATH TO UNICODE */xOff+lineTo.getX()*scale,// death to unicode
/* DEATH TO UNICODE */yOff+lineTo.getY()*scale*yFlip,// death to unicode
/* DEATH TO UNICODE */color);// death to unicode
/* DEATH TO UNICODE */prev=cmd;// death to unicode
/* DEATH TO UNICODE */continue;// death to unicode
/* DEATH TO UNICODE */}// death to unicode
/* DEATH TO UNICODE */if(cmd.isImGlyphQuadCurveTo()){// death to unicode
/* DEATH TO UNICODE */ImGlyphQuadCurveToquadCurveTo=cmd.toImGlyphQuadCurveTo();// death to unicode
/* DEATH TO UNICODE */drawList.addBezierQuadratic(// death to unicode
/* DEATH TO UNICODE */xOff+prev.getX()*scale,// death to unicode
/* DEATH TO UNICODE */yOff+prev.getY()*scale*yFlip,// death to unicode
/* DEATH TO UNICODE */xOff+quadCurveTo.getX1()*scale,// death to unicode
/* DEATH TO UNICODE */yOff+quadCurveTo.getY1()*scale*yFlip,// death to unicode
/* DEATH TO UNICODE */xOff+quadCurveTo.getX()*scale,// death to unicode
/* DEATH TO UNICODE */yOff+quadCurveTo.getY()*scale*yFlip,// death to unicode
/* DEATH TO UNICODE */color,// death to unicode
/* DEATH TO UNICODE */1);// death to unicode
/* DEATH TO UNICODE */prev=cmd;// death to unicode
/* DEATH TO UNICODE */continue;// death to unicode
/* DEATH TO UNICODE */}// death to unicode
/* DEATH TO UNICODE */if(cmd.isImGlyphClosePath()){// death to unicode
/* DEATH TO UNICODE */drawList.addLine(// death to unicode
/* DEATH TO UNICODE */xOff+prev.getX()*scale,// death to unicode
/* DEATH TO UNICODE */yOff+prev.getY()*scale*yFlip,// death to unicode
/* DEATH TO UNICODE */xOff+first.getX()*scale,// death to unicode
/* DEATH TO UNICODE */yOff+first.getY()*scale*yFlip,// death to unicode