当前位置: 首页 > news >正文

吉林企业做网站营销方案案例范文

吉林企业做网站,营销方案案例范文,深圳平面设计公司排名前十强,营销的四种方式起因:做了个工具在console窗口罗列一些信息,基本结构是 [ 文件名 :行号 ],因为文件,行号长度不一,想要做到如下效果。 初步尝试,用以下方法: string format "{0,-10} …

起因:做了个工具在console窗口罗列一些信息,基本结构是 [ 文件名        :行号 ],因为文件,行号长度不一,想要做到如下效果。

初步尝试,用以下方法:

string format = "{0,-10} {1,5}";  // -10 表示左对齐,10个字符宽;5 表示右对齐,5个字符宽
Debug.Log(string.Format(format, "File", "Line"));
Debug.Log(string.Format(format, "UI/Titan/UI_Titan_Main", "1"));
Debug.Log(string.Format(format, "Utils/GlobalFunction", "8"));

实际效果如下:

竟然没对齐?拷贝到IntelliJ 里查看

Utils/GlobalFunction                              |        :8
Lua/HookReloadLuaFuc                              |       :35
Lua/HookReloadLuaFuc                              |     :1290

IntelliJ用了等宽字符,所以看起来是对齐的。

后续就简单了,拿到console里字体的宽度就行了。

这里贴一个大概的实现,宽度表放在最后

一个简单的lua实现

local _QuickJumpTab = {"Utils/GlobalFunction:8","Lua/HookReloadLuaFuc:35:print_table","Lua/HookReloadLuaFuc:1290:print_table","UI/Titan/TitanUtil:10:泰坦相关Gid",
}local function GetFileLine(str)local strTab = split(str,":")return unpack(strTab)
end-- 判断是否是中文字符 并且返回字符长度
local function IsChineseChar(char)local byte = string.byte(char)if byte >= 0x80 thenreturn true,2elsereturn false,1end
endlocal function Utf8StringLen(str)local len = 0local strTab = StringToUtf8Table(str)for i, v in ipairs(strTab) doif IsChineseChar(v) thenlen = len + 12elselen = len + _ConsoleCharWidth[v] or 3 -- 3 is width of spaceendendreturn len
endlocal longestStr = ""
for k, v in pairs(_QuickJumpTab) dolocal fileStr = GetFileLine(v)if Utf8StringLen(fileStr) > Utf8StringLen(longestStr) thenlongestStr = fileStrend
end
local longestStrLen = Utf8StringLen(longestStr)
--logGreen("longestStrLen\t" .. longestStrLen)local _wrapColor = function(color,str)return concat({"<color=",color,">",str,"</color>"})
end-- 自己实现一个往左边或者右边加空格补齐长度的函数
-- 用于打印的时候对齐
local FillLen = function(str,len,align,fillStr)align = align or "left"local strLen = Utf8StringLen(str)if strLen >= len thenreturn strendlocal spaceLen = len - strLenlocal needFillCount = max(spaceLen,1)if not fillStr thenfillStr = " "needFillCount = needFillCount/_ConsoleCharWidth[fillStr]endlocal spaceStr = string.rep(fillStr,ceil(needFillCount))if align == "right" thenreturn concat({str,spaceStr})elsereturn concat({spaceStr,str})end
endlocal exSymbolLen = _ConsoleCharWidth[":"] + _ConsoleCharWidth["["] + _ConsoleCharWidth["]"]local _WrapDebugStr = function(file,line,des,fileColor,lineColor)fileColor = fileColor or "#CA550C"--"cyan"lineColor = lineColor or "#00FFFF"local maxFileLen = longestStrLen+8local fileStr = FillLen(file,maxFileLen,"right")local lineStr = FillLen(":" .. line,36,"left")fileStr = _wrapColor(fileColor,fileStr)lineStr = _wrapColor(lineColor,lineStr)local desFillStr = "-"local fillCharWidth = _ConsoleCharWidth[desFillStr]maxFileLen = maxFileLen + 36 + exSymbolLenif des thenlocal colorLen = Utf8StringLen("<color=white></color>")des = _wrapColor("white",des)des = FillLen(des,(maxFileLen+colorLen)/fillCharWidth,"right",desFillStr)elsedes = FillLen("",maxFileLen/fillCharWidth,"left",desFillStr)endstr = format("[%s%s]\n%s",fileStr,lineStr,des)return str
end
_ConsoleCharWidth = {[" "] = 3,["!"] = 3,["\""] = 5,["#"] = 8,["$"] = 7,["%"] = 11,["&"] = 9,["'"] = 3,["("] = 4,[")"] = 4,["*"] = 6,["+"] = 8,[","] = 3,["-"] = 6, -- 4 original["."] = 3,["/"] = 4,[":"] = 3,[";"] = 3,["<"] = 8,["="] = 8,[">"] = 8,["?"] = 7,["@"] = 12,["["] = 4,["\\"] = 4,["]"] = 4,["^"] = 6,["_"] = 5,["`"] = 3,["{"] = 5,["|"] = 3,["}"] = 5,["~"] = 8,A = 8,B = 8,C = 9,D = 9,E = 7,F = 7,G = 9,H = 9,I = 3,J = 7,K = 8,L = 7,M = 11,N = 9,O = 9,P = 8,Q = 9,R = 8,S = 8,T = 8,U = 9,V = 8,W = 11,X = 8,Y = 8,Z = 8,a = 7,b = 7,c = 7,d = 7,e = 7,f = 4,g = 7,h = 7,i = 3,j = 3,k = 7,l = 3,m = 10,n = 7,o = 7,p = 7,q = 7,r = 4,s = 6,t = 4,u = 7,v = 7,w = 10,x = 6,y = 6,z = 6,["0"] = 8,["1"] = 6,["2"] = 7,["3"] = 8,["4"] = 8,["5"] = 7,["6"] = 7,["7"] = 7,["8"] = 7,["9"] = 7,
}
http://www.dt0577.cn/news/33168.html

相关文章:

  • 莞城做网站公司互联网营销策划方案
  • 网站建设中upl连接教你如何快速建站
  • 打开网站需要用户名密码关键词生成器 在线
  • 如何做网站优化关键词优化百度快速排名提升
  • 网站建设iis配置补肾壮阳吃什么药效果好
  • 免费外贸网站建设安徽seo优化规则
  • 有什么网站是做办公家具深圳网络推广营销
  • 科技平台网站建设站长查询域名
  • 杭州网站排名优化软件推广接单平台
  • 正规的营销型网站建设怎么线上推广自己的产品
  • 企业官网建站的流程佛山百度快速排名优化
  • 提供网站建设设计推广软文发布平台
  • 2017年网站开发用什么语言推广吧
  • 站台建筑营销策划方案怎么做
  • 如何在网站做旅游产品百度pc端提升排名
  • 松江专业做网站公司电商广告
  • wordpress自动水印代码赣州seo排名
  • 专业网站建设-好发信息网怎么联系百度人工服务
  • wordpress 随机标签云宁波seo营销平台
  • 武汉 网站建设百度快照替代
  • 给彩票网站做代理违法吗优化设计全部答案
  • 源码交易平台网站源码看b站视频下载软件
  • 郑州公交app宝鸡百度seo
  • 精品网站建设需要多少钱百度站长中心
  • 企业网站建设运营自建站怎么推广
  • 工业网站建设百度竞价推广流程
  • 网站设计运行费用关键词优化公司电话
  • 网站推广的分类现在推广引流什么平台比较火
  • 美橙西安网站备案拍照企业推广是什么职业
  • 怎么做同学录的网站开发一款app软件需要多少钱