📄 text.c
字号:
/*以下代码用于显示各地区的中英文简介*/static PLOGFONT logfontttf1, logfontttf2;int Beijing_Text (HDC hdc){ RECT rc1, rc2; const char* szBuff_Beijing_1 = " 北京历史简介 \n" "北京简称京,是中国的首都,全国的政治、文化中心和国际交往的" "枢纽,也是一座著名的历史文化名城,与西安、洛阳、开封、南京、" "杭州并列为中国六大古都。"; const char* szBuff_Beijing_2 = "The general situation of Beijing\n"
"Beijing is the capital of PRC, which is the center of National politics," " culture, transport, tourism and international exchanges. Located" " on north latitude 39°56', east 116°20'. The whole city makes up " "of 11 zones and 7 counties.The modern Beijing has experienced about ten " "generation of operation, which had numerous illustrious Emperor City's sight" " and rich handsome cultural background, the world's largest imperial Palace " "and our Chinese largest temple of heaven,which is rarely seen in the Summer " "Palace of Royal garden, Great Wall."; rc1.left = 25; rc1.top = 45; rc1.right = 306; rc1.bottom = 150; rc2.left = 25; rc2.top = 150; rc2.right = 306; rc2.bottom = 427; SetBkColor (hdc, COLOR_lightgray); //设置字体背景颜色 SetTextColor (hdc, PIXEL_darkred); //设置字体颜色 SetPenColor(hdc, PIXEL_blue); //设置线条颜色 SetBrushColor (hdc, PIXEL_lightgray); FillBox(hdc, rc1.left, rc1.top, rc1.right-25, rc2.bottom); Rectangle (hdc, rc1.left, rc1.top, rc1.right, rc1.bottom); Rectangle (hdc, rc2.left, rc2.top, rc2.right, rc2.bottom); InflateRect (&rc1, -1, -1); InflateRect (&rc2, -1, -1); SelectFont (hdc, logfontttf2); DrawText (hdc, szBuff_Beijing_1, -1, &rc1, DT_NOCLIP | DT_LEFT | DT_WORDBREAK); SelectFont (hdc, logfontttf2); DrawTextEx (hdc, szBuff_Beijing_2, -1, &rc2, 13, DT_LEFT | DT_CHARBREAK);}int Tokyo_Text (HDC hdc){ RECT rc1, rc2; const char* szBuff_Beijing_1 = " 东京历史简介 \n" "东京东南濒临东京湾,通连太平洋。其行政区划为“都”,下辖23个特别区、1郡、26市、7町、8村以及伊" "豆群岛、小笠原群岛。面积2187平方公里,人口1200万左右。"; const char* szBuff_Beijing_2 = "The general situation of Tokyo\n"
"The sheer level of energy is the most striking aspect of Japan's capital " "city. Tokyo remains a glittering example of the 'miracle' of post World War" " II Japan. Streets are lined with tiny specialist shops and bustling restaurants" ", most of which stay open late into the night. Close to the soaring office blocks" " exist pockets of another Tokyo - an old wooden house, a Japanese inn, an old lady" " in a kimono sweeping the pavement outside her home with a straw broom. More than" " anything else,Spring is the best time to visit Tokyo."; rc1.left = 25; rc1.top = 45; rc1.right = 306; rc1.bottom = 150; rc2.left = 25; rc2.top = 150; rc2.right = 306; rc2.bottom = 427; SetBkColor (hdc, COLOR_lightgray); //设置字体背景颜色 SetTextColor (hdc, PIXEL_darkred); //设置字体颜色 SetPenColor(hdc, PIXEL_blue); //设置线条颜色 SetBrushColor (hdc, PIXEL_lightgray); FillBox(hdc, rc1.left, rc1.top, rc1.right-25, rc2.bottom); Rectangle (hdc, rc1.left, rc1.top, rc1.right, rc1.bottom); Rectangle (hdc, rc2.left, rc2.top, rc2.right, rc2.bottom); InflateRect (&rc1, -1, -1); InflateRect (&rc2, -1, -1); SelectFont (hdc, logfontttf2); DrawText (hdc, szBuff_Beijing_1, -1, &rc1, DT_NOCLIP | DT_LEFT | DT_WORDBREAK); SelectFont (hdc, logfontttf2); DrawTextEx (hdc, szBuff_Beijing_2, -1, &rc2, 13, DT_LEFT | DT_CHARBREAK);}int Newyork_Text (HDC hdc){ RECT rc1, rc2; const char* szBuff_Beijing_1 = " 纽约历史简介 \n" "纽约,是美国人口最多的城市,包括其都市圈,它拥有世界上最大的城市区。" "超过一个世纪的时间,纽约是世界上最主要的商业和金融中心,纽约是美国最大" "城市及第一大港。 "; const char* szBuff_Beijing_2 = "The general situation of Newyork\n"
"New York or New York City (officially The City of New York), a city in the " "state of New York, is the most populous city in the United States. For more " "than a century, it has been one of the world's leading business, financial and" " cultural centers and its influence in politics, education, entertainment, sports" ", media, fashion and the arts all contribute to its status as one of the major" " global cities. As the home of the United Nations, the city is a hub for" " international diplomacy,Residents of the city are known as New Yorkers."; rc1.left = 25; rc1.top = 45; rc1.right = 306; rc1.bottom = 150; rc2.left = 25; rc2.top = 150; rc2.right = 306; rc2.bottom = 427; SetBkColor (hdc, COLOR_lightgray); //设置字体背景颜色 SetTextColor (hdc, PIXEL_darkred); //设置字体颜色 SetPenColor(hdc, PIXEL_blue); //设置线条颜色 SetBrushColor (hdc, PIXEL_lightgray); FillBox(hdc, rc1.left, rc1.top, rc1.right-25, rc2.bottom); Rectangle (hdc, rc1.left, rc1.top, rc1.right, rc1.bottom); Rectangle (hdc, rc2.left, rc2.top, rc2.right, rc2.bottom); InflateRect (&rc1, -1, -1); InflateRect (&rc2, -1, -1); SelectFont (hdc, logfontttf2); DrawText (hdc, szBuff_Beijing_1, -1, &rc1, DT_NOCLIP | DT_LEFT | DT_WORDBREAK); SelectFont (hdc, logfontttf2); DrawTextEx (hdc, szBuff_Beijing_2, -1, &rc2, 13, DT_LEFT | DT_CHARBREAK);}int Rome_Text (HDC hdc){ RECT rc1, rc2; const char* szBuff_Beijing_1 = " 罗马历史简介 \n" "纽约,是美国人口最多的城市,包括其都市圈,它拥有世界上最大的城市区。" "超过一个世纪的时间,纽约是世界上最主要的商业和金融中心,纽约是美国最大" "城市及第一大港。 "; const char* szBuff_Beijing_2 = "The general situation of Rome\n"
"New York or New York City (officially The City of New York), a city in the " "state of New York, is the most populous city in the United States. For more " "than a century, it has been one of the world's leading business, financial and" " cultural centers and its influence in politics, education, entertainment, sports" ", media, fashion and the arts all contribute to its status as one of the major" " global cities. As the home of the United Nations, the city is a hub for" " international diplomacy. "; rc1.left = 25; rc1.top = 45; rc1.right = 306; rc1.bottom = 150; rc2.left = 25; rc2.top = 150; rc2.right = 306; rc2.bottom = 427; SetBkColor (hdc, COLOR_lightgray); //设置字体背景颜色 SetTextColor (hdc, PIXEL_darkred); //设置字体颜色 SetPenColor(hdc, PIXEL_blue); //设置线条颜色 SetBrushColor (hdc, PIXEL_lightgray); FillBox(hdc, rc1.left, rc1.top, rc1.right-25, rc2.bottom); Rectangle (hdc, rc1.left, rc1.top, rc1.right, rc1.bottom); Rectangle (hdc, rc2.left, rc2.top, rc2.right, rc2.bottom); InflateRect (&rc1, -1, -1); InflateRect (&rc2, -1, -1); SelectFont (hdc, logfontttf2); DrawText (hdc, szBuff_Beijing_1, -1, &rc1, DT_NOCLIP | DT_LEFT | DT_WORDBREAK); SelectFont (hdc, logfontttf2); DrawTextEx (hdc, szBuff_Beijing_2, -1, &rc2, 13, DT_LEFT | DT_CHARBREAK);}int Berlin_Text (HDC hdc){ RECT rc1, rc2; const char* szBuff_Beijing_1 = " 柏林历史简介 \n" "纽约,是美国人口最多的城市,包括其都市圈,它拥有世界上最大的城市区。" "超过一个世纪的时间,纽约是世界上最主要的商业和金融中心,纽约是美国最大" "城市及第一大港。 "; const char* szBuff_Beijing_2 = "The general situation of Berlin\n"
"New York or New York City (officially The City of New York), a city in the " "state of New York, is the most populous city in the United States. For more " "than a century, it has been one of the world's leading business, financial and" " cultural centers and its influence in politics, education, entertainment, sports" ", media, fashion and the arts all contribute to its status as one of the major" " global cities. As the home of the United Nations, the city is a hub for" " international diplomacy. "; rc1.left = 25; rc1.top = 45; rc1.right = 306; rc1.bottom = 150; rc2.left = 25; rc2.top = 150; rc2.right = 306; rc2.bottom = 427; SetBkColor (hdc, COLOR_lightgray); //设置字体背景颜色 SetTextColor (hdc, PIXEL_darkred); //设置字体颜色 SetPenColor(hdc, PIXEL_blue); //设置线条颜色 SetBrushColor (hdc, PIXEL_lightgray); FillBox(hdc, rc1.left, rc1.top, rc1.right-25, rc2.bottom); Rectangle (hdc, rc1.left, rc1.top, rc1.right, rc1.bottom); Rectangle (hdc, rc2.left, rc2.top, rc2.right, rc2.bottom); InflateRect (&rc1, -1, -1); InflateRect (&rc2, -1, -1); SelectFont (hdc, logfontttf2); DrawText (hdc, szBuff_Beijing_1, -1, &rc1, DT_NOCLIP | DT_LEFT | DT_WORDBREAK); SelectFont (hdc, logfontttf2); DrawTextEx (hdc, szBuff_Beijing_2, -1, &rc2, 13, DT_LEFT | DT_CHARBREAK);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -