Windows Phone 7 Development log (Question 2, font)

Source: Internet
Author: User
Tags dotnet

The xNa-based examples are as follows. MainlyCodeIt seems that people have a feeling of returning to the past, that just stack code, to achieve a little bit of functionality in the past.

Many examples of coding methods seem to be without anyProgramTraining, learned to gather a few syntaxes, just in the debut of beginners engaged in development. No clear context can be found in the structure and ideas, and code reuse and scalability are completely absent from the author's brain. These opinions only represent personal opinions. If they are unpleasant, please forgive me.

If this level represents the average level of xNa developers in China, we have an unoptimistic future. I never thought that xNa and DOTNET framework were toys. Since Microsoft launched the DOTNET platform in China, I first got vs2003 and kept an eye on its development. Advanced languages are trends and irreversible trends. However, I have never been a full-time DOTNET developer because of my life or various reasons. Perhaps this kind of attention and regret that I have not been involved in it, let me face the sensitivity of domestic DOTNET platform graphics development.

However, this is far more important than this. In the past, many applications did not use DOTNET because of the inconvenience of release. On the PC platform, the native C ++ and DirectX could not fight back, in Xbox Live, because regular manufacturers use native sdks for development and retail, xNa developed by houniang cannot be the mainstream. The grief of the past is gone, leaving a strong heart ready to bear the grief of the present.

Xna3.1 log on to zunehd and become the only graphic interface. Windows Phone 7 determines xna4 as the only graphic interface, xna4 with shader model3. The good news is that Microsoft has finally brought Zune, Windows Phone, and DOTNET developers to this market, the only one that can stay away from the language competition. I can believe that all this is just the beginning. In the operating system, application is also a trend. For the underlying and native development methods, it will become increasingly small. For Microsoft, DOTNET is the future. For graphics, xNa is the future. To Microsoft's loyalty, isn't the future clear now? Should we invest in it? Whether for the nuggets or for interest.

Xna4, Have you joined today?

Hope and disappointment are always inseparable. I added a few groups developed by xNa, and I visited several forums. I am helpless and disappointed to face all the questions without nutrition, the indifference to Zune and Windows Phone, and the grief of xNa on PC. Even if DOTNET becomes the mainstream day, it will never be those who stand on the stage.

Xna4 has not been officially released yet, bro, where are you. I am not an obligation promoter of xNa. On the PC platform, I am a full-time C ++ developer. I have no special feelings for xNa, just because Windows Phone 7, so DOTNET, so xNa. It took a week to discover no potential competitors. What is the boring situation.

Let's get started with nuggets Windows Phone 7.

Xna4 game positioning, Microsoft's platform provider identity, is doomed to xNa is only draw design, DX's younger brother. The missing link between xna4 and final products is part of my focus. As I move forward, the progress I have made is a valuable asset for future users.

I have been doing scene management in the past few days when I was empty. I don't have the best graphics, but it is the most suitable. In addition, the basic part has already flattened the technical barriers, but shader cannot be applied on Windows Phone 7. In addition, I found that Chinese on xNa has never been an elegant solution over the past few days. I think there are only two words for the solutions using GDI +: braindamage. My comment on the solution kidnapped by the PC platform is only two words: strong. People who spend so much energy doing vigorous things can only be called bored.

My head trembled, and I saw a business opportunity. I developed an elegant TrueType font solution. It took about a month or two to determine the value of the solution based on my self-recognition. When the latecomer joins the ranks, he will invest 5 W in development to implement the same functions as me. If he invests less than 5 W, he will be able to implement the same functions, I have been a programmer for all these years. Just listen to these bragging words. What matters is an elegant xNa Chinese display solution, which is of commercial value. Because it is a program of commercial value, I will only release the database, and the source code will be hidden.

The xNa graphics engine is scheduled to change and the TrueType display scheme has a higher priority than the terrain.

In addition, there is an input scheme embedded in the game's input method, which hangs first, depending on the time windows phone7 multi-language support. There are no Chinese input methods available on mobile phones and they are still available in China. Such a joke is impossible. The key is whether this Chinese input method can be used in xNa applications. This is unlikely. Compared with other mobile phone platforms horizontally, the input in the game is very embarrassing.

If Windows Phone 7 still ignores the input method in the xNa application, I will develop another xNa input method module, which undoubtedly has direct commercial value.

After a long time, I did not say a word in the font.

Http://www.microsoft.com/typography/SpecificationsOverview.mspx

My solution is to directly load the TTF file for parsing and dynamically generate a font in the memory. The above link is Microsoft's description of the TTF file format. I got it in the middle of the night, using simsunb. TTF is the test object, and the basic data of the font file is read and analyzed. The rest is the analysis and display of the profile data. 10% degree of completion for the entire solution.

The usage is as follows, all of which are pseudo code.

Clge_font font = new clge_font ("simsunb. TTF ");

I haven't written the final output scheme yet, but I have already made it clear in my mind.

Output 1: output to the model is actually implemented using Output 2. The source code is provided.

Clge_font.makemesh (vertex format, string input string, model size)

Output 2: output to the path.

The path is the vertex list.

If you can use these paths for results, I will ignore them. For example, if you create a flash effect on each path and combine the output from the upstairs, you can achieve a fireworks effect on the edge of the word. You can use the path to create a model. I provide examples for creating a model from a path, such as creating a model with a guide and a hollow-text model.

Clge_font.makepathlist (string input string)

Output 3: output to texture

Clge_font.writetotexture (ushort character, int font size, rect target output area)

Output 4. Draw the string directly.

This is only an encapsulation of output 3 and will provide the source code.

Showfont sfont = new showfont (clge_font font, int font size, bool dynamic cache or static cache)

// The dynamic cache creates only one texture and deletes the earliest Paster Based on the frequency adjustment. The static cache creates another image when the texture is full

Spritebatch. Begin ();

Sfont. Draw (spritebatch, string display string, int X, int y); // provides the implementation of spritebatch output. If you use other engines for UI output, modify the source code accordingly.

Spritebatch. End ();

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.